#include <iostream> #include <cstdio> using namespace std; struct no{ string name; int age; string blc; int shengao; int tizhong; }; int main(int argc, char** argv) { freopen("student.txt","w",stdout); no asd; for(int i=0;i<5;i++){ cin>>asd.name>>asd.age>>asd.blc>>asd.shengao>>asd.tizhong; cout<<asd.name<<" "<<asd.age<<" "<<asd.blc<<asd.shengao<<" "<<asd.tizhong; cout<<endl; } fclose(stdout); return 0; } /* wanghuali 3 nan 150 222 guliheng 1 nan 160 222 zhangzhanqian 160 nan 1 222 guhaokun 1 nan 163 222 yeiaoyu 1 nan 161 222 */
标签:tizhong,文件,string,no,int,asd,blc,结构 From: https://www.cnblogs.com/guoliheng/p/18619865