运行下面程序时,若从键盘输入数据为"123",
则输出结果是_____.
#include "stdio.h"
void main()
{ int num,i,j,k,place;
scanf("%d",&num);
if (num>99)
place=3;
else if(num>9)
place=2;
else
place=1;
i=num/100;
j=(num-i*100)/10;
k=(num-i*100-j*10);
switch (place)
{ case 3: printf("%d%d%d\n",k,j,i);
break;
case 2: printf("%d%d\n",k,j);
break;
case 1: printf("%d\n",k);
}
}
A) 123 B) 1,2,3 C) 321 D) 3,2,1
登录后提交答案