c++ 코드 에러 질문
조회수 702회
#include <iostream> //2
using namespace std;
struct student {
int id;
int name[10];
int sc[3];
int total;
double ave;
};
void main() {
struct student ST[5];
int i, j;
for (i = 0; i < 5; i++) {
cin >> ST[i].id >> ST[i].name;
for (j = 0; j < 3; j++)
cin >> ST[i].sc[j];
ST[i].total = ST[i].sc[0] + ST[i].sc[1] + ST[i].sc[2];
ST[i].ave = ST[i].total / 3.0;
}
cout << "번 호 이 름 국어 영어 수학 합계 평균\n";
for (i = 0; i < 5; i++)
cout << ST[i].id << "\t" << ST[i].name << "\t" << ST[i].sc[0] << "\t" << ST[i].sc[1]
<< "\t" << ST[i].sc[2] << "\t" << ST[i].total << "\t" << ST[i].ave << endl;
}
심각도 코드 설명 프로젝트 파일 줄 비표시 오류(Suppression) 상태 오류 C2679 이항 '>>': 오른쪽 피연산자로 'int [10]' 형식을 사용하는 연산자가 없거나 허용되는 변환이 없습니다.
로 오류뜨는데 이유가 뭐죠?
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력