#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;} 帮我找出错误 然后改过来 择优为满意答案 不分先后
第1题:
下面代码段的输出是( )。
A.编译出错
B.5752
C.true
D.无任何输出
第2题:
12、下面代码的运行结果是 def func(num): num+=1 a=10 func(a) print(a)
A.10
B.int
C.11
D.出错
第3题:
找出错误并修改下面的代码: public class Test{ public static void main(String[] args){ double[100] r; for(int i = 0; i < r.length(); i++); r(i) = Math.random * 100; } }指出错误代码的位置,并写出修改后的正确代码。提交的作业内容中的程序代码以代码格式提交(如题目中的代码)。
第4题:
阅读下列说明、c++代码和运行结果,填补代码中的空缺(1)~(6),将解答填入
答题纸的对应栏内。
【说明】
很多依托扑克牌进行的游戏都要先洗牌。下面的c++程序运行时先生成一副扑克牌,
洗牌后再按顺序打印每张牌的点数和花色。
【c++代码】
inciude <iostream>
4Finclude <stdlib. h>
include <ctime>
inciude <aigorithm>
include <string>
Using namespace std
Const string Rank[13]={”A”,”2”,”3”,”4“,“5”,”6,”’“7”8“,9”,”10,”J”,
”Q”,”K”}j//扑克牌点数
第5题:
5、下面代码的输出结果是()。 def printpara(x): '''just print x''' print(x) printpara("Hi")
A.just print x
B.x
C.Hi
D.出错
第6题:
11、下面代码的运行结果是 def func(num) : num += 1 a = 10 func(a) print(a)
A.10
B.11
C.出错
D.int