제출 #499476

#제출 시각아이디문제언어결과실행 시간메모리
499476adamLjeto (COCI21_ljeto)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int a[9]; int main() { int t,f,l,p=0,o=0,n; cin>>n; for (int i=0;i<n;i++) { cin>>t>>f>>l; if (f>=1 && f<=4) { if (t-a[f]<=10 && a[f]!=0) { p+=150; a[f]=t; } else { p+=100; a[f]=t; } } else if (a<=8 && a>=5) { if (t-a[f]<=10 && a[f]!=0) { o+=150; a[f]=t; } else { o+=100; a[f]=t; } } } cout<<p<<' '<<o; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

Main.cpp: In function 'int main()':
Main.cpp:25:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |         else if (a<=8 && a>=5)
      |                  ~^~~
Main.cpp:25:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |         else if (a<=8 && a>=5)
      |                          ~^~~