请读程序: #include<stdio.h> main() { inta;floatb,c: scanf("%2d%3f%4f',&a,&b,&c); printf("\na=%d,b=%f,c=%f\n".a,b,c); } 若运行时从键盘上输入9876543210,则上面程序的输出结果是______。
A.a=98,b=765,c=4321
B.a=10,b=432,c=8765
C.a=98,b=765.000000,c=4321.000000
D.a=98,b=765.0,c=4321.0
第1题:
请读程序: #include<stdio.h> main() { int a;float b,c; scanf("%2d%3f%4f",&a,&b,&c); printf("\na=%d,b=%f,c=%f\n",a,b,c) } 若运行时从键盘上输入987643210则上面程序的输出结果是______。
A.a=98,b=75,c=4321
B.a=10,b=432,c=8765
C.a=98,b=765.000000c=4321.000000
D.a=98,b=765.0,c=4321.000000
第2题:
请读程序: #include<stdio.h> main() { int a;float b,c; scanf("%2d%3t%4f",&a,&b,&c); printf("\na=%d,b=%f,c=%f\n",a,b,c); } 若运行时从键盘上输入(图片),则上面程序的输出结果是______。
A.a=98,b=765,c=4321
B.a=10,b=432,c=8765
C.a=98,b=765.000000,c=4321.000000
D.a=98,b=765.0,c=4321.0
第3题:
执行以下程序时输入1234567<CR>,则输出结果是【 】。
include <stdio.h>
main()
{ int a=1,b;
scanf("%2d%2d",&a,&b); prinff("%d %dhn",a,b);
}
第4题:
请读程序:#include <stdio. h>main(){ int a; float b, c; scanf ("% 2d% 3%/4f",&a,&b,&c); printf("\na=%d, b=%f, c=%f\n", a, b, c);} 若运行时从键盘上输入9876543210
,则上面程序的输出结果是______。
A.a=9b=765, c=4321
B.a=10,b=432,c=8765
C.a=98,b=765.000000,c=4321.000000
D.a=98,b=765.0,c=4321.0
第5题:
下列程序运行时输入1234567<CR>,则输出结果是______。
include<stdio.h>
main()
{ int a=1,b;
scanf("%2d%2d",&a,&b);printf("%d %d\n", a,b);
}
本题考查的重点是scanf函数的调用。scanf(“格式化字符串>”,地址表>),格式化字符串后可以加上场宽,本题中两个变量的场宽都为2,所以输入1234567CR>后,变量a的值为12。变址b的值为34,从而输出为12 34。