#include <iostream>using 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; cin>>a; student[i].name = a; cout<<"enter chinese performance :"<<endl; cin>>student[i].chinese; cout<<"enter math performance :"<<endl; cin>>student[i].math; cout<<"enter english performance :"<<endl; cin>>student[i].english; }}void outputinfo(){ int i = 0; while(i < 5) { cout<<i+1<<" student's information"<<endl; cout<<student[i].name.c_str()<<endl; cout<<"chinese "<<endl; cout<<student[i].chinese<<endl; cout<<"math "<<endl; cout<<student[i].math<<endl; cout<<"english "<<endl; cout<<student[i].english<<endl; 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;} 帮我找出错误 然后改过来 择优为满意答案 不分先后
[填空题] 电源出错的代码是()。
[单选题]下面代码运行后,s的值是()。A . 20B . 12C . 10D . 6
[单选题]下面代码的运行结果是( )。 public class ConcatTest { public static void main (String[ ] args) { String str1 = "abc"; String str2 = "ABC"; String str3 = str1. coneat(str2); System. out. println(str3); } }A.abcB.ABCC.abcABCD.ABCabc
[判断题] 显示代码包括显示内容编码和出错代码;电能表如果发生出错故障,显示器应立即停留在该代码上。A . 正确B . 错误
[单选题]下列会出错的代码是______。 (1) public void modify( ){ (2) int I,j,k; (3) i=100; (4) while(i>0){ (5) j=i*2; (6) System.out.println("The value of j is"+j); (7) k=k+1; (8) } (9) i--; (10) }A.第4行B.第6行C.第7行D.第8行
[单选题]编译和运行下面代码时的显示结果是()。A . HelloB . elloC . elloHD . 编译错误
[单选题]编译和运行下面代码后显示的结果是()。A . 编译报错误B . 2C . 1D . 0
[单选题]编译和运行下面代码时显示的结果是()。A . Error Variable i may not have been initializedB . nullC . 1D . 0
[单选题]编译并运行下面的Java代码段输出结果是()。A.代码无法编译,因为switch语句没有一个合法的表达式B.adefaultC.aD.default
[单选题]下面代码的运行结果是 public class Test{ public static void main(String args[]){ for(int i=0; i<3;i++){ if(i<2) continue; System.out.println(i); } } }A.0B.1C.2D.3