我也会用调用函数啦!!!
#include <iostream>
using namespace std;
struct students{
int a;
string name;
int b;
int c;
int d;
};
void input(int n,students *s){
for(int i=0;i<n;i++){
cin>>s[i].a>>s[i].name>>s[i].b>>s[i].c>>s[i].d;
}
}
void print(int n,students *s){
for(int i=0;i<n;i++){
cout<<s[i].a<<" "<<s[i].name<<" "<<s[i].b<<" "<<s[i].c<<" "<<s[i].d<<endl;
}
}
int main()
{
int n;
cin>>n;
students s[n];
input(n,s);
print(n,s);
return 0;
}
从初学者到如今能熟练的运用调用函数,我这一路走来真的不容易,希望在以后能有日日有进步,月月有精进!