网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
定义chars[81];后,能正确输入一个字符串到数组s的语句是()。

A.gets(s);

B.scanf(”%c”,s);

C.scanf(”%s”,&s[0]);

D.gets(&s[0]);


参考答案

更多 “ 定义chars[81];后,能正确输入一个字符串到数组s的语句是()。 A.gets(s);B.scanf(”%c”,s);C.scanf(”%s”,D.gets( ” 相关考题
考题 下面各语句中,能正确进行赋字符串操作的语句是A.char s[5]= { "ABCDE" };B.char s[5]= { 'A' ,' B' ,' C' ,' D' ,' E' };C.char *s; s = "ABCBE";D.char *s; scanf("%s", s);

考题 能正确进行字符串赋值、赋初值的语句组是()。 A、chars[5]={a,e,i,o,u};B、char*s;s=“good!“;C、chars[5]=“good!“;D、chars[5]=“good!“;

考题 以下能正确进行字符串赋值、赋初值的语句是______。A.char s[5]:{'a','e','i','o','u'};B.char *s; s="good";C.char s[5]="good";D.char s[5]; s="good";

考题 12、下面各语句中,能正确进行字符串赋值操作的语句是:A.char s[5]={"ABCDE"};B.char s[5]={'A','B','C','D','E','\0'};C.char *s="ABCDE";D.char *s; scanf("%s", s);

考题 下列是为字符数组赋字符串的语句组,其中错误是:A.char s[10]; s=”program”;B.char s[]=”program”;C.char s[10]=”Hello!”;D.char s[10];strcpy(s,”hello!”);

考题 1.定义一个名为s的字符型数组,并且赋值为字符串"123"的错误语句是 。A.char s[]={ '1', '2', '3', '0'};B.char s[]={ "123"};C.char s[3]={ '1', '2', '3'};D.char s[4]={ '1', '2', '3'};

考题 请编写函数cpy(char s1[ ], char s2[ ]),其功能是实现字符串的复制(不能使用库函数strcpy), 即把字符数组s2中的字符串复制到字符数组s1中。 例如main函数中输入"hello",“world”,则最后输出``world” ;

考题 下列各语句行中,能正确进行赋字符串操作的语句是()A.char s[5]={"ABCDE"};B.char s[5]={'A' ,'B','C','D','E'};C.char *s; s="ABCDE";D.char *s; *s="ABCDE";

考题 5、下列是为字符数组赋字符串的语句组,其中错误是:A.char s[10]; s=”program”;B.char s[]=”program”;C.char s[10]=”Hello!”;D.char s[10];strcpy(s,”hello!”);