若运行时给变量x输入12,则以下程序的运行结果是( )。
A: nclude <stdio.h>
B: t main()
C: t x,y; scanf("%d",&x); y=x>12?x+10:x-12; printf("%d\n",y); return 0;
D: 4
E: 3
F: 2
G: 0
A: nclude <stdio.h>
B: t main()
C: t x,y; scanf("%d",&x); y=x>12?x+10:x-12; printf("%d\n",y); return 0;
D: 4
E: 3
F: 2
G: 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
- 若运行时给变量x输入12,则以下程序的运行结果是_______ main() { int x,y; scanf("%d",&x); y=x+10; printf("%d,%d ",x,y); }
- main { int x,y; scanf(“%d”,&x); y=x>12?x+10:x-12; printf(“%d ”,y); }
- 若运行时给变量x输入12,则以下程序的运行结果是 include void main( ) { int 若运行时给变量x输入12,则以下程序的运行结果是 #include<iostream.h> void main( ) { int x,y; cin > > x; y=x > 12? x+lO:x-12; cout < < y; cout < < end1; } A.0 B.22 C.12 D.10
- 若运行以下程序时输入:5<;回车>;,则程序的运行结果是 。#include <;stdio.h>;int main(){int x,y;scanf("%d",&x);if (x>;=0)if (x>;0) y=1;else y=0;else y=-1;printf("x=%d,y=%d\n",x,y);return 0;}