以下求1*2*3......*20的程序正确的是:
A: main(){inti,term;i=1;term=0;do{term=term*i;i++;}while(i<=20)
A: main(){inti,term;i=1;term=0;do{term=term*i;i++;}while(i<=20)
printf("t=%d",term);}
B: main(){inti,term;i=1;term=1;do{term=term*i;i++;}while(i<=20)
printf("t=%d",term);}
C: main(){inti,term;term=1;for(i=1,i<=20,i++)
{term=term*i;i++;}printf("t=%d",term);}
D: main(){inti,term;term=1;for(i=1;i<=20;i++)
{term=term*i;i++;}printf("t=%d",term);}
举一反三
- 下面程序流程图的功能是计算 1*2*3 + 3*4*5+…+ 99*100*101的值,则图中空白的矩形框内应该填写的是( )。[img=112x200]18031e6573312a4.jpg[/img] A: term=i*(i+1)*(i+2) B: term= (i-1)*i*(i+1) C: term=term+(i-1)*i*(i+1) D: term= term+i*(i+1)*(i+2)
- By the time next month, I ________ my term paper.
- I don’t think he has finished the term paper, ______ A: had he B: do I C: has he D: hasn’t he
- I failed in the final examination last term and only then ________the importance of studies.
- main(){inti=1,sum;while(i<10);{sum=sum+i;i++;}printf(i=%d,sum=%d,i,sum);}