64,637
社区成员
发帖
与我相关
我的任务
分享
#include<iostream>
#include <string>
using namespace std;
struct Student
{
int num;
char name[20];
float score[3];
};
void print(Student stu);
int main()
{
void print(Student);
Student stu;
stu.num=12345;
strcpy(stu.name,"谭浩强比较坑爹");
stu.score[0]=60;
stu.score[1]=70;
stu.score[2]=80;
print(stu);
system("pause");
return 0;
}
void print(Student stu)
{
cout<<stu.num<<stu.name<<stu.score[0]<<stu.score[1]<<stu.score[2]<<endl;
}