简单程序问题
17 以下程序的运行结果是___。main()
{ printf("%12.5f\n",123.1234567);
printf("%12f\n",123.1234567);
printf("%12.8d\n",12345);
printf("%12.8s\n","abcdefghij");
}
19 运行以下程序时,如从键盘上输入:a=3,b=5↙35,35.12↙abc↙后,结果是___。
main()
{ int a,b; float x,y; char c1,c2;
scanf("a=%d,b=%d",&a,&b);
scanf("%f,%e",&x,&y);
scanf("%c%c%c",&c1,&c1,&c2);
printf("a=%d,b=%d,x=%f,y=%f,c1=%c,c2=%c\n",a,b,x,y,c1,c2);
}
答案:
17、 123.12346
123.123457
00012345
abcdefgh
19、a=3,b=5,x=35.000000,y=35.119999,c1=a,c2=b
解释得答案过程:(等待指教)