下列程序的执行结果为_____。Dim intsum As IntegerDim I As Integerintsum=0For I=20.2 To 5 Step -4.7intsum=intsum +INext IPrint intsum
举一反三
- 计算下列程序段的时间频度和时间复杂度?intsum=0;for(inti=1;i<=n;i++){sum+=i;}
- 下列程序的运行结果是:publicclassTest{publicstaticvoidmain(Stringargs[]){intm[]={1,2,3,4,5,6,7,8};intsum=0;for(inti=0;i8;i++){sum=sum+m[i];if(i==3)break;}System.out.println(sum);}}
- 请阅读下面的程序,sum的值为()publicclassTest{publicstaticvoidmain(String[]args){intsum=0;for(inti=1;i=100;i++){if(i%2==1){continue;}sum+=i;}System.out.println(sum=+sum);}}
- 下面的代码输出结果是()。intsum=0;for(inti=0;i<10;i=i+2){if(i%3==0)sum=sum+i;}Console.WriteLine(sum); A: 0 B: 6 C: 20 D: 18
- 下列语句中,将函数intSum(intx,inty)正确重载的是() A: floatSum(intx,inty); B: intSum(inta,intb); C: floatSum(floatx,floaty); D: doubleSum(inty,intx);