填空题
以下程序的功能是:将输入的正整数按逆序输出。例如:若输入135则输出531。请填空。
#include
main()
{ int n,s;
prinff("Enter a number:");scanf("%d",&n);
printf("output: ");
do
{ S=n%10;printf("%d",s).【 】;}
while(n!=O);
printf("\n");
}
【参考答案】
n/=l0或n=n/10
热门
试题
单项选择题
有以下程序#includevoid f(char P[][10],int n)/*字符串从小到大排序*/{char t[10];int i,j;for(i=0;iO){strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j],t);}main(){char p[5][10]={ abc , aabdfg , abbd , dcdbe , cd };f(P,5);printf( %d\n ,strlen(p[0]));}程序运行后的输出结果是【 】。
A.2
B.4
C.6
D.3