1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #include <iostream> using namespace std; int a[21]; int main(){ int x,y,y1,jk,j1,g,e; x=3465;y=264;jk=20; for (j1=1; j1 <=20; ++j1)a[j1]=0; while (y!=0){ y1=y%10; y=y/10; while (y1!=0){ g=x; for (e=jk;e>=1; --e){ g=g+a[e]; a[e]=g%10; g=g/10; } y1=y1-1; } jk=jk-1; } j1=1; while (a[j1]==0)j1=j1+1; for (jk=j1; jk<=20; ++jk)cout<<" "<<a[jk]; return 0; } |
0 of 4 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
1、第14行的g=g+a[e]改为g+=a[e],程序输出结果不变。( )
2、将第06行的jk=20改为jk=2,程序输出结果不变。( )
3、将第6行的x=3465和y=264改为x=y=0,则程序输出结果为0。
4、程序输出结果为( )。