对于如下程序:#include [stdio.h] int main() { int x = 0; int y = 0; char a = 'a'; char b = 'b'; a = getchar (); scanf ("%d%d", &x, &y); b = getchar (); printf ("%d %d %c %c", x, y, a, b);}如果输入流是12 C,程序的输出是什么?
举一反三
- 以下程序输出的结果是____________.#include [stdio.h]int main(){ int x=30,y=7; x=y=x%y; printf("%d\n",x); return 0;}
- 若运行时为变量x输入12 则以下程序的运行结果是 include stdio h int main int x y scanf d x y x 12 x 10 x 12 printf d n y return 0 A0B22C12D10
- 输入“12345,xyz”,下列程序输出的结果是____。 int main { int x;char y; scanf (“%3d%3c”,&x,&y); printf (“%d,%c”,x,y);}
- 下面程序运行后的输出结果是_________。#include [stdio.h]int main(){ int x=10,y=20,t=0; if(x==y) t=x;x=y;y=t; printf("%d",x);}
- 以下程序没有语法问题的是() A: B: include<;stdio.h>;int main( ){int x , y = 5 ; printf( "%d\n" , x / y ) ; return 0 ;} C: D: include<;stdio.h>;int main( ){int x = 3 ;y = 5 ; printf( "%d\n" , x / y ) ; return 0 ;} E: F: include<;stdio.h>;int main( ){int x = 3 ,y ; printf( "%d\n" , x / y ) ;y = 5; return 0 ;} G: H: include<;stdio.h>;int main( ){int x = 3 , y = 5 ; printf( "%d\n" , x / y ) ; return 0 ;}