에 호환되지 않습니다. 따라서 8 번째 줄에 문제가 있습니다. "인수 유형 int가 매개 변수 유형 int와 호환되지 않습니다"라는 오류 메시지가 나타납니다. 나는 오류의 의미를 이해하지 못한다. 내가 도대체 뭘 잘못하고있는 겁니까?오류 : 인수 유형 int가 매개 변수 유형
const int NUM_TEST = 5;
int perfectScore(int score[]);
int main()
{
int score ;
double enteredScore[] = {0.00};
int location = 1;
location = perfectScore(score);
cout << "This program will allow you to enter up to 5 scores and will then report how many test scores are entered.\n" << endl;
int perfectScore(int score[]);
for (int i = 0; i<=NUM_TEST; i++) {
cout << "Enter a test score in the range 0 to 100: ";
cin >> i;
}
if(score != 100)
{
cout << "The 5 test scores you entered included " << enteredScore[score] << "perfect scores" << endl;
}
system("pause");
return 0;
}
int perfectScore(int score[])
{
int countPerfect = -1;
for(int i = 0; i < NUM_TEST; i++)
{
if(score[i]==100)
{
countPerfect =1;
}
}
return countPerfect;
}
당신이 쓰고있는 언어와 버전을 분명히하고 싶을 수도 있습니다. –
점수가 int 인 것처럼 보이지만 perfectScore의 인수는 int [] 또는 int * – ryanyuyu
입니다. C++을 사용하고 있습니다. 버전별로 무엇을 의미합니까? – sylvanna