NSMutableDictionary *mutableDic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"lisi",@"name",[NSNumber numberWithInt:20],@"age", nil];
[mutableDic setObject:@"89" forKey:@"num"];
NSLog(@"mutableDic4 = %@“,mutableDic);
控制台打印是:
A: name = lisi;num = 89
B: age = 20;name = lisi;num = 89
C: age = 20;name = lisi
D: age = 20
[mutableDic setObject:@"89" forKey:@"num"];
NSLog(@"mutableDic4 = %@“,mutableDic);
控制台打印是:
A: name = lisi;num = 89
B: age = 20;name = lisi;num = 89
C: age = 20;name = lisi
D: age = 20
举一反三
- 1)运行下面一段代码,能正确输出的是(C)。(选择两项) A: A.int age=20;string name=”如花”;<br>Console.write(“姓名”+name+”年龄”+age); B: B.int age=20;string name=”如花”;<br>Console.write(“姓名{0},年龄为{1}”,name,age); C: C.int age=20;string name=”如花”;<br>Console.write(name,age); D: D.int age;string name;<br>Console.write(“姓名”+name+”年龄”+age);
- 下列保存数据格式错误的是() A: sessionStorage.setItem(‘name’, ‘lisi’) B: localStorage.name = ‘lisi’ C: sessionStorage.push(‘name’, ‘lisi’) D: sessionStorage [‘name’]=’lisi
- 以下语法符合JSON格式的是( )。 A: { name:'Mary';age:20, } B: { name:'Mary';age:20 } C: { name:'Mary', age:20, } D: { name:'Mary', age:20 }
- struct AA{struct studend{int num;char name[20];int age;}stud[100];int length;}ss;例如已经存入20信息,ss.length=20;输出全班数据,填程序for(i=0;i<;( 1 );i++) //填空处(1){cout<;<;ss.stud[i].num<;<;"\t"<;<;ss.stud[i].name<;<;"\t"<;<;ss.stud[i].age<;<;endl;}插入数据到第2个位置,填程序for(i=ss.length;i>;1;i--){ss.stud[i].num=ss.stud[(2)].num;//填空处(2)strcpy(ss.stud[i].name,ss.stud[(2)].name);ss.stud[i].age=ss.stud[(2)].age;}ss.stud[1].num=1802;strcpy(ss.stud[1].name,“wang”);ss.stud[1].age=17;ss.length++;[/i][/i][/i][/i][/i][/i]
- 以下结构体的定义语句中,正确的是______。? struct student {int num; char name[10];int age;}stu;|struct {int num; char name[10];int age;}student; struct student stu;|struct student {int num; char name[10]; int age;}; student stu;|struct student {int num; char name[10];int age;};stu;