有以下程序,若运行时从键盘输入:18,11<;回车>;,则程序输出结果是_______ 。#include "stdio.h"void main(){ int a,b;printf("Enter a,b:");scanf("%d,%d",&a,&b);while(a!=b){ while(a>;b) a-=b;while(b>;a) b-=a; }printf("%3d%3d\n",a,b); }
A: 1 1
B: 1 2
C: 1 3
D: 1 4
A: 1 1
B: 1 2
C: 1 3
D: 1 4
举一反三
- 以下程序的运算结果是_______。#include<;stdio.h>;int main( ){ int a=14, b=63;while (a!=b){ while (a>;b) a-=b;while (a<;b) b-=a;}printf (“%d\n”,a);return 0;}
- 以下程序的运行结果是_________。#include "stdio.h"void main(){int m=1,s=1;do{++m;if(m%3!=0)continue;elses=s*m;printf("%d\n",s);}while(m<10);}
- 有以下程序,若从键盘给n输入的值是-3,则程序的输出结果是 #include intmain() { ints=0,a=1,n; scanf("%d",&n); do { s+=1; a=a-2; }while(a!=n); printf("%d\n",s); return0; }
- 以下程序执行后的输出结果是()。main(){int k=5;while(--k)printf("%d",k-=3);printf("\n");} A: 1 B: 2 C: 4 D: 死循环
- 【单选题】以下程序的输出结果是()#include<stdio.h>intmain(void){intnum=0;while(num<=2){num++;printf("%d ",num);}return0;} A. 1 B. 1 2 C. 1 2 3 D. 1 2 3 4