主题:[讨论]新手遇到问题了帮帮忙啊!!!~~~~
// Note:Your choice is C++ IDE
#include <iostream>
#include<string>
using namespace std;
struct Student
{
int num;
char name[20];
float score[3];
};
int main()
{
void print(Student);
Student stu;
stu.num=12345;
stu.name="Li Fung";
stu.score[0]=0;
stu.score[1]=89;
stu.score[2]=78.5;
print(stu);
return 0;
}
void print(Student stu)
{
cout<<stu.num<<" "<<stu.score<<" "stu.score[0]<<" "
<<stu.score[1]<<" "<<stu.score[2]<<endl;
}
#include <iostream>
#include<string>
using namespace std;
struct Student
{
int num;
char name[20];
float score[3];
};
int main()
{
void print(Student);
Student stu;
stu.num=12345;
stu.name="Li Fung";
stu.score[0]=0;
stu.score[1]=89;
stu.score[2]=78.5;
print(stu);
return 0;
}
void print(Student stu)
{
cout<<stu.num<<" "<<stu.score<<" "stu.score[0]<<" "
<<stu.score[1]<<" "<<stu.score[2]<<endl;
}