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

题目内容 (请给出正确答案)

若输入ab,程序运行结果为【 】 main() { static char a[3]; scanf("%s",a); printf("%c,%c",a[1],a[2]); }

A.b

B.a,

C.b,

D.程序出错


参考答案和解析
第一空: No answer. Open
更多 “若输入ab,程序运行结果为【 】 main() { static char a[3]; scanf("%s",a); printf("%c,%c",a[1],a[2]); }A.bB.a,C.b,D.程序出错” 相关考题
考题 ( 12 ) 有以下程序#include stdio.h#include string.hvoid fun ( char *str ){ char temp;int n,i;n=strlen ( str ) ;temp=str[n-1];for ( i=n-1;i0;i-- ) str[i]=str[i-1];str[0]=temp;}main (){ char s[50];scanf ( " %s " ,s ) ; fun ( s ) ; printf ( " %s\n " ,s ) ;}程序运行后输入: abcdef 回车 ,则输出结果是 【 12 】 。

考题 当运行以下程序时,输入 abcd ,程序的输出结果是 : 【 9 】 。insert(char str[]){ int i;i=strlen(str);while(i0){ str[2*i]=str[i];str[2*i-1]='*'; i--;}printf(" % s\n",str);}main(){ char str[40];scanf(" % s",str);insert(str);}

考题 有以下程序#include stdio.hmain(){ char a[20]="How are you?",b[20];scanf("%s",b); printf("%s %s\n",a,b);}程序运行时从键盘输入: How are you? 回车 则输出结果为 【 1 3 】 。

考题 在执行下述程序时,若从键盘输入6和8,则结果为main(){ int a,b,s;scanf("%d%d",a,b);s=aif(ab)s=b;s*=s;printf("%d",s); }A.36B.64C.48D.以上都不对

考题 运行下列程序时,若输入的数据为“1,2,3”,则输出结果是( )。 main() { float a,b,c,t; scanf("%f,%f,%f",a,b,c); if(a<A.int a[5]={0,1,2,3,4,5};B.char a[]={0,1,2,3,4,5};C.char a={'A','B','C');D.int a[5]="0123";

考题 当输入a1b2c3d4e时,下列程序的运行结果为______。main(){ char str[40]; printf("请输入含有4个数字字符的字符串:\n"); scanf("%s",str); insert(str);}insert(str)char str[];{ int i; for(i=strlen(str);i>0;i--) { str[2*i)=str[i]; str[2*i-1)=' '; } printf("\n结果是:%s",str);}A.a 1 b 2 c 3 d 4 eB.1 2 3 4C.a 1 b 2D.因输入错误,程序出错

考题 若输入12345、abc,程序的输出结果为______。 main() { int a; char ch; scanf("%3d,%3c",a,ch); printf("%d,%c",a,ch); }A.123,abcB.123,4C.123,aD.12345,abc

考题 执行下列程序时输入:123456789,输出结果是()main(){ char s[100]int c,i;scan 执行下列程序时输入:123<空格>456<空格>789<回车>,输出结果是( ) main() { char s[100] int c,i; scanf("%c",C) ; scanf("%d",i); scanf("%s",s); printf("%c,%d,%s\n",c,i,s); }A.1,456,789B.1,23,456C.1,23,456,789D.123,456,789

考题 若运行输入:3,则以下程序的输出结果是( )。 main() {int a,b; scanf("%d",A); b=(a>=0 若运行输入:3<回车>,则以下程序的输出结果是( )。 main() {int a,b; scanf("%d",A); b=(a>=0)?a:-a; printf("b=%d",B); }

考题 若输入ab,程序运行结果为______。 main() { static char a[2]; scanf("%s",a); printf("%c,%c",a[1],a[2]); }A.a,bB.a,C.b,D.程序出错

考题 若有如下程序: main() {static char*a[3]={"123","456","789"); char **b; b=a; ++b; printf("%s,%s\n",*a,*a+1); printf("%s,%s\n",*b,b[1]); } 则程序运行后的输出结果是( )。A.123,456, 456,789B.123,23 456,56C.123,23 456,789D.123,456 456,56

考题 若执行下列程序时从键盘上输入2,则输出结果是()。 inclUde main() {int a; scanf("%d", 若执行下列程序时从键盘上输入2,则输出结果是( )。#inclUde<stdio.h>main(){int a;scanf("%d",A);if(a++<3)printf("%d\n",A);else printf("%d\n",a--);}A.1B.3C.2D.4

考题 有以下程序 include main() {char c1,c2;scanf("%c",*c1);while(c190)scanf("% 有以下程序include<stdio.h>main(){ char c1,c2;scanf("%c",*c1);while(c1<65||c1>90) scanf("%c",c1);c2=c1+32;printf("%c,%c\n",c1,c2);}程序运行输入6回车后,自否输出结果、结束运行(请回答能或不能)【 】。

考题 下列程序运行时,若输入labcedf2df输出结果为【】。 include main(){char a=0,ch; wh 下列程序运行时,若输入labcedf2df<回车>输出结果为【 】。include<stdio.h>main(){ char a=0,ch;while((ch==getchar())!='\n'){ if(a%2!=0(ch>='a'ch<='z')) ch=ch'a'+'A';a++;prtchar(ch);}printf("\n");}

考题 以下程序运行后输入:3,abcde回车,则输出结果是【 】include move(char *str, 以下程序运行后输入:3,abcde回车,则输出结果是【 】include <string.h>move(char *str, int n){ char temp; int i;temp=str[n-1];for(i=n-1;i>0;i--) str[i]=str[i-1];str[0]=temp;}main( ){ char s[50]; int n, i, z;scanf("%d,%s",n,s);z=strlen(s);for(i=1; i<=n; i++) move(s, z);printf("%s\n",s);}

考题 有以下程序includemain(){ char*p,*q;p=(char *)malloc(sizeof(char)*20);q=p;scanf( 有以下程序 #include<stdlib.h> main() { char*p,*q; p=(char *)malloc(sizeof(char)*20);q=p; scanf(“%s%s”,p,q);printf(“%s%s\n”,p,q); } 若从键盘输入:abc def<回车>,则输出结果是A.def defB.abc defC.abc dD.d d

考题 有以下程序include main(){ char *p,*q;p=(char*)malloc(sizeof(char)*20);q=p;scanf 有以下程序 #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20); q=p; scanf("%s %s",p,q); printf("%s %s\n",p,q); } 若从键盘输入:abc def<回车>, 则输出结果是A.def defB.abc delC.abc dD.d d

考题 若输入“abcdef”“abdef”,下述程序的输出结果为( )。 #includestdio.h #includestring.h main { int n; char s1[20],s2[20],*p1,*p2; scanf("%s",s1); scanf("%S",s2); p1=s1; p2=s2; n=strcmp(p1,p2); printf("Vood\n",n); }A. -1B.0C."abcdef"D."abdef"

考题 运行下面的程序,输入字符串Microsoft Visual Studio,则程序的执行结果是()。includemai 运行下面的程序,输入字符串Microsoft Visual Studio,则程序的执行结果是( )。 #include<stdio.h> main() {char Chr[20]; scanf("%s",Chr); printf("%s\n”,Chr); }A.Microsoft Visua1 StudioB.MC.MicrosoftD.MicrosoflVisualStudio

考题 下面程序的运行结果是includeincludemain(){ char*s1="AbDeG";char*s2="Ab 下面程序的运行结果是 #include<stdio.h> #include<string.h> main() { char*s1="AbDeG"; char*s2="AbdEg"; s1+=2;s2+=2; printf("%d\n",strcmp(s1,s2)); }A.正数B.负数C.零D.不确定的值

考题 以下程序:includemain(){char str[10];scanf("%s",str);printf("%s\n",str);}运 以下程序: #include<stdio.h> main() {char str[10]; scanf("%s",str); printf("%s\n",str); } 运行上面的程序,输入字符串how are you,则程序的执行结果是( )。A.howB.how are youC.hD.howareyou

考题 设有如下程序: #include'string.h" main() { static char s1[20],s2[20]; scanf("%s",s1);scanf("%s",s2); if(strcmp(s1,s2)) printf("@"); else printf("$"); printf("%d\n",strlen(strcat(s1,s2))); } 如果从键盘上输入name1<回车>name2<回车>,则程序运行后的输出结果是( )。A.$9B.@11C.$10D.@10

考题 执行下列程序时输入:123456789输出结果是main(){char s[100];int c,i; scanf( 执行下列程序时输入:123<空格>456<空格>789<回车>输出结果是 main() { char s[100];int c,i; scanf("%c",c);scanf("%d",i);scanf("%s",s); printf("%c,%d,%s\n",c,i,s);}A.123,456,789B.1,456,789C.1,23,456,789D.1,23,456

考题 有以下程序: #includestdio.h, main( ) {int S; scanf("%d",s); while(sO) {switch(s) {case l:printf("%d",s+5); case 2:printf("%d",s+4);break; case 3:printf("%d",s+3); default:("%d",s+1);break; } scanf("%d",s); } } 运行时,若输入1 2 3 4 5 0回车,由输出结果是( )。A.6566456B.66656C.66666D.6666656

考题 有以下程序: include main( ) { char *p ,* q; p=(char * )malloc(sizeof(char 有以下程序: #include<stdlib.h> main( ) { char *p ,* q; p=(char * )malloc(sizeof(char) * 20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是A.def defB.abc defC.abc dD.d d

考题 以下程序的运行结果为______。 char *c []={ "ENTER", "NEW", "POINT", "FIRST" }; char **cp []={ c+3, c+2, c+1, c}; char ***cpp=cp; main () {printf ("%s\n",**++cpp); }A.ENTERB.NEWC.POINTD.FIRST

考题 若输入 "I am a boy!",下列程序的运行结果为______。 char connect(string1,string2,string) char string1[],string2[],string[]; { int i,j; for (i=0;stringl[i] !='\0';i++) string[i]=stringl[i]; for (j=0;string2[j] !='\0';j++) string[i+j]=string2[j]; string[i+j ] ='\0'; } main ( ) { char s1 [100] , s2 [100] , s [100]; printf ("\n 输入 string1: \n"); scanf("%s",s1); printf (" \n 输入 string2: \n" ); scanf ("%s", s2); connect (s1, s2, s); printf ("%s\n", s); }A.I am a boy!B.输入string2:C.I amD.I am a boy!

考题 当运行以下程序时,输入abcd,程序的输出结果是:( )。insert(char str[]){int i;i=strlen(str);while(i>0){str[2*i]=str[i];str[2*i-1]='*';i--;}printf("%s\n",str);}main(){char str[40];scanf("%s",str);insert(str);}