回覆列表
  • 1 # 南風微涼南巷靜待

    #include

    #include

    #include

    usingnamespacestd;

    structstudent{

    intno;

    stringname;

    ints_m;

    ints_cn;

    ints_en;

    intsum;

    floatavg;

    }stu[5];

    intmain()

    {

    inti;

    cout

    ofstreamout("f3.txt");

    if(!out){cout

    cout

    for(i=0;i

    {

    cin>>stu[i].no>>stu[i].name>>

    stu[i].s_m>>stu[i].s_cn>>stu[i].s_en;

    out

    stu[i].s_m

    }

    cout

    out.close();

    cout

    ifstreamin("f3.txt");

    if(!in){cout

    cout

    for(i=0;i

    {

    in>>stu[i].no>>stu[i].name>>

    stu[i].s_m>>stu[i].s_cn>>stu[i].s_en;

    if(!in){cout

    stu[i].sum=stu[i].s_m+stu[i].s_cn+stu[i].s_en;

    stu[i].avg=stu[i].sum/3;

    cout

    stu[i].s_m

    }

    in.close();

    }

  • 中秋節和大豐收的關聯?
  • 下聯為:葉生葉落知春秋,如何對上聯?