若有语句:chars1[]="apple1",s2[8],*s3,*s4="apple2";则对库函数strcpy错误调用的是______
A: strcpy(s1,"apple2");
B: strcpy(s4,"apple1");
C: strcpy(s3,"apple1");
D: strcpy("apple2",s2);
A: strcpy(s1,"apple2");
B: strcpy(s4,"apple1");
C: strcpy(s3,"apple1");
D: strcpy("apple2",s2);
举一反三
- 若有定义char s1[ ]= “HELLO”, s2[8] = “HELLO1”,s3[80],*s4=s2; 则错误的是 A: strcpy(“s1”, “HELLO”); B: strcat(s2, “hello2”); C: strcpy(s3, “hello3”); D: strcpy(s4, “hello4”);
- main() {chararr[2][4]; strcpy(arr,”you”);strcpy(arr[1],”me”); arr[0][3]=’&’; printf(“%s”,arr);}
- 以下程序的运行结果为( )。class Apple { int n1 = 5; static int n2 = 0; void fun() { n1++; n2++; } } public class Main { public static void main(String[] args) { Apple apple1 = new Apple(); Apple apple2 = new Apple(); apple1.fun(); System.out.print(apple1.n1 + "," + apple1.n2 + ";"); apple2.fun(); apple2.fun(); System.out.print(apple2.n1 + "," + apple2.n2); } }
- 对于字符串和for循环的知识点,现设置代码如下:[img=413x259]17da6f9eb7df542.png[/img]请分析这段代码的输出结果为( )。 A: {'grape': '1',apple': '2','watermelon': '3','lemon': '4'} B: {grape:1,apple:2,watermelon:3,lemon:4} C: ['grape';'1', 'apple':12', 'watermelon';'3','lemon';'4'] D: [grape:1,apple:2,watermelon:3,lemon:4]
- 39号元素钇的核外电子排布式是下列排布中的( ) A: 1 s 2 2 s 2 2 p 6 3 s 2 3 p 6 3 d 10 4 s 2 4 p 6 4 d 1 5 s 2 B: 1 s 2 2 s 2 2 p 6 3 s 2 3 p 6 3 d 10 4 s 2 4 p 6 5 s 2 5 p 1 C: 1 s 2 2 s 2 2 p 6 3 s 2 3 p 6 3 d 10 4 s 2 4 p 6 4 d 2 5 s 1 D: 1 s 2 2 s 2 2 p 6 3 s 2 3 p 6 3 d 10 4 s 2 4 p 6 5 s 2 5 p 1