9.以下程序段运行时,如果从键盘输入1298再回车,则输出结果为int n1, n2;scanf("%d", &n2);while (n2 != 0){ n1 = n2 % 10; n2 = n2 / 10; printf("%d", n1);}
A: 1298
B: 1
C: 9
D: 8921
A: 1298
B: 1
C: 9
D: 8921
举一反三
- 以下程序段运行时,如果从键盘输入1298再回车,则输出结果为int n1, n2;scanf("%d", &n2);while (n2 != 0){ n1 = n2 % 10;n2 = n2 / 10;printf("%d", n1);}
- 以下程序段运行时,如果从键盘输入1298再回车,则输出结果为 int n1, n2; scanf("%d", &n2); while (n2 != 0) { n1 = n2 % 10; n2 = n2 / 10; printf("%d", n1); }
- 下面N×N的笛卡尔积的子集中,哪些可以构成函数? A: {(n1,n2) | n1,n2∈N and n1+n2 <10} B: {(n1,n2) | n1,n2∈N and n2 = n1^2} C: {(n1,n2) | n1,n2∈N and n1 = n2^2} D: {(n1,n2) | n1,n2∈N and n2为小于n1的素数个数}
- 设n=n1n2,(n1,n2)=1,n1≥1,n2≥1,则φ(n)=φ(n1)φ(n2).若n=n1n2,n1≥1,n2≥1,则φ(n)=φ(n1)φ(n2)?
- 设有以下程序: main( ) { int n1,n2; scanf("%d",&n2); while(n2!=0) { n1=n2%10; n2=n2/10; printf("%d",n1); } } 程序运行时,如果从键盘上输入1298;则输出结果为__________________ A: 1298 B: 8 C: 89 D: 8921