下面程序的输出结果是_______。 unsigned fun(unsigned num) { unsigned k=1; do { k*=num%10; num/=10; }while(num); return(k); } main() { unsigned n=26; printf("%d\n",fun(n)); }
A.0
B.4
C.12
D.无限次循环
第1题:
以下程序的输出结果是 【 】 。
include<iostream.h>
unsigned fun (unsigned num)
{unsigned k=1;
do{k*=num%10;num/=10;} while(num);
return k;
}
void main( )
{ unsigned n=26;
cout <<fun(n) <<end1
第2题:
以下程序的输出结果是【 】。
include<iostream.h>
unsigned frn(ullsigned num)
{ unsi9ned k=1;
do{k*=num%10;num/=10;} while(num);
return k;
}
void main()
{ unsigned n=26;
cout<<fun(n) <<endl;
}
第3题:
下面程序的输出结果是【 】。
unsigned fun6(unsigned num)
{ unsigned k=1;
do { k*=hum%10;
num/=10;}while(num);
return(k); }
main()
{ unsigned n=26;
printf("%d\n",fun6(n));}
第4题:
运行下列程序时,若输入数据为“321”,则输出结果是( )。 main() {int num,i,j,k,s; scanf("%d",&num); if(num>99) s=3; else if(num>9) s=2; else s=1; i=num/100; j=(num-i*100)/10; k=(num-i*100-j*10); switch(s) {case 3:printf("%d%d%d\n",k,j,i); break; case 2:printf("%d%d\n",k,j); case 1:printf("%d\n",k); } }
A.123
B.1,2,3
C.321
D.3,2,1
第5题:
以下程序的输出结果是unsigned fun6(unsigned num){ unsigned k=1; do{k *=num%10;num/=10;} while (num); return k;}main(){ unsigned n=26; printf("%d\n", fun6(n));}