//164 : 배열2 - 형성평가5

#include<iostream>

using namespace std;


typedef struct {

int one;

int two;

int three;

}sixgradeclass;


int main()

{

sixgradeclass c[4];

for (int i = 0; i < 4; i++) {

cout << i + 1 << "class? ";

cin >> c[i].one

>> c[i].two

>> c[i].three;

}

for (int i = 0; i < 4; i++) {

cout << i + 1 << "class : " << (c[i].one + c[i].two + c[i].three)  << '\n';

}

return 0;

}


문제 출처 : http://www.jungol.co.kr/bbs/board.php?bo_table=pbank&wr_id=64&sca=10a0

+ Recent posts