网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
11、在平时成绩记录器中,下列代码运行后,Total的意义是 ToTal = 0:i = 5:flat = 1 While flat If Cells(i, 1) <> "" And Cells(i, 2) <> "" Then ToTal = ToTal + 1 i = i + 1 Else flat = 0 End If Wend
A.学生人数
B.作业次数
C.至少交过一次作业的学生人数
D.以上都不对
参考答案和解析
C
更多 “11、在平时成绩记录器中,下列代码运行后,Total的意义是 ToTal = 0:i = 5:flat = 1 While flat If Cells(i, 1) <> "" And Cells(i, 2) <> "" Then ToTal = ToTal + 1 i = i + 1 Else flat = 0 End If WendA.学生人数B.作业次数C.至少交过一次作业的学生人数D.以上都不对” 相关考题
考题
有一过程如下:Sub Sub1(m As Integer,total As Long)Dim i As Integertotal=1For i=1 To mtotal=total*iNextEnd Sub调用它的事件过程如下:Private Sub Command1_Click()Dim tot As Long,a As Integera=Val(InputBox("请输入数据"))Call Sub1(a,tot)Print totEnd Sub则输入数据5,运行结果为【 】。
考题
(11)下列程序用于在带垂直滚动条的文本框Text1中输出3到100之间的全部素数。请填空。 Private Sub Command1_Click() Text1.Text="" For n=3 To 100 k=Int(Sqr(n)) i=2 Flag=0 Do While i= And Flag=0 If n Mod i=0 Then Flag=1 Else i=i+1 End If Loop If Then Text1.Text=Text1.TextStr(n)Chr(13)Chr(10) End If Next n End Sub
考题
c++,运行下面代码出错
#include iostreamusing namespace std;struct student_info{ string name; int chinese; int math; int english;};student_info student[5];void inputinfo(){ int i = 0; char a[20]; for(i = 0;i 5;i++) { cout"enter the "i+1" student's information "endl; cout"enter the name"endl; cina; student[i].name = a; cout"enter chinese performance :"endl; cinstudent[i].chinese; cout"enter math performance :"endl; cinstudent[i].math; cout"enter english performance :"endl; cinstudent[i].english; }}void outputinfo(){ int i = 0; while(i 5) { couti+1" student's information"endl; coutstudent[i].name.c_str()endl; cout"chinese "endl; coutstudent[i].chineseendl; cout"math "endl; coutstudent[i].mathendl; cout"english "endl; coutstudent[i].englishendl; i++; }}int avgfunction(int arr[],int n){ int i = 0; int total = 0; for(i = 0;i n;i++) { total += arr[i]; } return total / n;}void computavg() //这里是否正确?{ int theavg = 0; theavg = avgfunction(student[i].chinese,5); }int main(){ inputinfo(); outputinfo(); computavg(); cin.get(); return 0;} 帮我找出错误 然后改过来 择优为满意答案 不分先后
考题
下面的程序的功能是将数组array下标为奇数的元素相乘(数组的位置是从0开始的),并将乘积存放到变量total中。请在程序的每条横线处填入适当的语句,使程序的功能完整。注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。public class JiShuJi{public static void main(String args[ ]){int array[ ]={1,2,3,5,7,9};long total= ________________________;for(int i=1;i<=__________________ i++){____________________i++;}System.out.println(total);}}
考题
下面程序的功能是将数组array下标为奇数的元素相乘(数组的位置是从0开始的),并将乘积存放到变量 total中。请在程序的每条横线处填写—个位运算符,使程序的功能完整。注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。源程序代码文件清单如下:public class JiShuJi{public static void main(String args[]){int array[ ]={1,2,3,5,7,9};long total=for(int i=1;i<=______;i++){______;i++;}System.out.println(total);}}
考题
对于如下程序,单击Co皿andl事件发生后,窗体上显示的内容为 ______。 Private Sub Command1_Click() Dim i As Integer,a a As Integer Do While i<20 Do While True If i Mod 10 = 0 Then Exit Do Else i=i-1 End If Loop i=i+11 a=a+1 Loop Print a End SubA.21B.32C.33D.11
考题
运行下面的程序I = 0DO WHILE I10IF INT(I/2)=I/2?"偶数"ELSE ?"奇数"ENDIFI=I+1ENDDO问语句?"奇数"被执行的次数是A.5B.6C.10D.11
考题
下列程序的执行结果是( )。 Privaae Sub Form_Activate Dim score(3)As Integer,total As Integer Dim aa_score As Variant score(1)=50:score(2)=14:score(3)=36 total=0:i=0 For Each aa_score In score i=i+1 total=total+aa_score Print i,aa_score,total Next End SubA.1 0 0 2 50 50 3 14 64 4 36 100B.1 50 50 2 14 64 3 36 100C.0 50 50 1 14 64 2 36 100 3 36 100D.0 0 0 1 50 50 2 14 64
考题
阅读以下函数说明和C语言函数,将应填入(n)处的字句写在对应栏内。【说明】有n个整数,使其前面各数顺序向后移m个位置,最后m个数变成最前面的m个数。【函数】main(){int number[20],n,m,i;printf("the total numbers is:");scanf("%d",n);printf("back m:");scanf("%d",m);for(i=0;i<=n-1;i)scanf("%d,",number[i]);(1);for(i=0;i<=n-1;i)printf("%d,",number[i]);}move(array,n,m)int n,m,array[20];{int *p,array_end;array_end=(2);for(p=array[n-1];(3);p--)*p=(4);*array=array_end;m--;if(m>0) (5);}
考题
运行下面的程序 I=0 DO WHILE I<10 IF INT (I/2)=I/2 ?“偶数” ELSE ?“奇数” ENDIF I=I+1 ENDDO 问语句?“奇数”被执行的次数是A.5B.6C.10D.11
考题
有如下的程序段,该程序段执行完后,共执行的循环次数是 total=0 Counter=1 Do Print Counter total=total * Counter + 1 Print total Counter=Counter +1 If total > 10 Then Exit Do End If Loop While Counter<=10A.4B.10C.15D.20
考题
有如下程序段,该程序段执行完后,执行循环的次数是 total=0 Counter=1 Do Print Counter total=total + Counter Print total Counter=Counter+1 If total>10 Then Exit Do End If Loop While Counter <=10A.5B.10C.15D.20
考题
有如下的程序段,该程序段的执行完后,共执行循环的次数是 Private Sub Command1_Click() total=0 Counter=l Do Print Counter total=total+Counter Print total Counter=Counter+1 If total>=10 Then Exit Do End If Loop While Counter<=10 End SubA.5B.10C.12D.20
考题
有过程如下:Sub fact (m As Integer, total As Long) Dim i As Integer total = 1 for i = 1 To m total = total*i Next iEnd Sub调用它的事件过程如下:Private Sub Command1_ Click () Dim tot As Long Dim a As Integer a = Val InputBox (“请输入数据”)) Call fact (a, tot) Print totEnd Sub则输入数据5,运行结果为 ______。A.100B.120C.200D.50
考题
有以下程序main( ){ int a[][3]={{1,2,3},{4,5,0}},(*pa) [3], i;pa=a;for(i=0;i<3;i+ +) if(i<2) pa[1][i] = pa[1][i]-1;else pa[1][i] = 1;cout<<a[0][1]+a[1][1]+a[1][2]<<end1;}执行后输出结果是A.7B.6C.8D.无确定值
考题
阅读下列程序,写出程序的运行结果【】。 include void main() { charstr1[ ]: "Hello,
阅读下列程序,写出程序的运行结果【 】。include<iostream. h>void main() { char str1[ ]: "Hello, World?;char str2[100];int i=0;do{if (str1[i]>= 'a' str1[i]<= 'z' )str2[i]=str1[i]-32;elsestr2[i]=strl [i];i++;}while(strl[i]!='\0');str2[i]='\0';cout<<str1<<end1;cout<<str2<<end1;}
考题
以下程序的输出结果是 main( ) { int i=0,a=0: while(i<20) { for{::) { if((i%10)==0)break; else i--; } i+=11;a+=i; } cout<<a<<end1; }A.21B.32C.33D.11
考题
当Form1_Click事件发生时,窗体上显示的第三行是( )。 Dim i As Integer,j As Integer,a(5,5) As Integer For i=1 To 5 For j=1 To 5 If(i<=j)Then a(i,j)=1 Else a(i,j)=0 End If Next j Next i For i=1 To 5 For j=1 To 5 Print a(i,j), Next j Print Next i End SubA.0 0 0 1 1B.0 0 1 1 1C.0 1 1 1 1D.1 1 1 1 1
考题
在窗体上画一个命令按钮,名称为Command1。然后编写如下程序: Private Sub Command1_Click() Dim i As Integer,a As Integer Do While i<20 Do While True If i Mod 10=0 Then Exit Do Else i=i-1 End If Loop i=i+11 a=a+i Loop Printa End Sub程序运行后,如果单击命令按钮,则在窗体上显示的内容是( )。A.21B.32C.33D.11
考题
运行下面的程序 I=0 DO WHILE I<10 IF INT (1/2)=I/2 ?"偶数" ELSE ? "奇数" ENDIF I=I+1 ENDDO 问语句?"奇数"被执行的次数是A.5B.6C.10D.11
考题
以下代码的运行结果为:public class Calc {public static void main (String args []) {int total = 0;for (int i = 0, j = 10; total >30; ++i, --j) {System.out.println(" i = " + i + " : j = " + j);total += (i + j);}System.out.println("Total " + total);}}A. 产生运行错误B. 产生编译错误C. 输出 "Total 0"D. 产生如下输出:i = 0 : j = 10i = 1 : j = 9i = 2 : j = 8Total 30
考题
以下选项中运行结果和以下代码相同的是vari=0;while(i5){i+=1;println(i)}()A、for(i-1to5){println(i)}B、for(i-0to5){println(i)}C、for(i-0until6){println(i)}D、for(i-1until5){println(i)}
考题
有如下程序段: int total = 0; for ( int i = 0; i 4; i++ ){ if ( i == 1) continue; if ( i == 2) break;total += i;} 则执行完该程序段后total的值为()A、0B、1C、3D、6
考题
单选题若要实现total=1+2+3+4+5求和,以下程序段错误的是( )。A
int i=1,total=1;
while(i5)
{
total+=i;
i+=1;
}B
int i=1,total=0;
while(i =5)
{
total+=i;
i+=1;
}C
int i=0,total=0;
while(i 5)
{
i+=1;
total+=i;
}D
int i=0,total=0;
while(i =5)
{
total+=i;
i+=1;
}
考题
单选题有如下程序段: int total = 0; for ( int i = 0; i 4; i++ ){ if ( i == 1) continue; if ( i == 2) break;total += i;} 则执行完该程序段后total的值为()A
0B
1C
3D
6
热门标签
最新试卷