编写程序,显示输出一个记录学生成绩的数组,该数组中有5个学生的数据记录,每

来源:百度知道 编辑:UC知道 时间:2024/05/24 23:53:55
希望详细点。 谢谢

#include <iostream>
#include <string>
using namespace std;

const int MAX_SIZE =5;

int main(){

int intArray[MAX_SIZE]={100,99,98,97,96};
string sArray[MAX_SIZE]={"Wang","Zhang","Li","Sun","Peng"};
for(int i=0;i<MAX_SIZE; i++){
cout<<"Name: "<<sArray[i]<<"\t";
cout<<" Mark: "<<intArray[i]<<endl;
}
}

就这吧 随便写的 没用指针