64,676
社区成员
发帖
与我相关
我的任务
分享
#include "stdafx.h"
#include <iostream>
using namespace std;
struct student_info
{
string strName;
int chinese;
int math;
int engilsh;
};
student_info student[50];
int main()
{
int i = 0;
char a[20];
for (i = 0; i < 50; i++)
{
cout << "Enter the " << i + 1 << " student's information : " << endl;
cout << "Enter name : ";
cin >> a;
student[i].strName = a;
cout<<"Enter Chinese performance : ";
cin >> student[i].chinese;
cout << "Enter Math performance : ";
cin >> student[i].math;
cout << "Enter English performance : ";
cin >> student[i].engilsh;
}
for (i = 0, i < 50, i++)
{
cout << "The " << i + 1 << " student's informance : " << endl;
cout << "Name : " << student[i].strName.c_str() << endl;
cout << "Chinese performance : " << student[i].chinese << endl;
cout << "Math performance : " << student[i].math << endl;
cout << "Engilsh performance : " << student[i].engilsh << endl;
}