제출 #1249062

#제출 시각아이디문제언어결과실행 시간메모리
1249062bethance별들과 삼각형 (IZhO11_triangle)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n;int ans=0;r=0,l=0; while(n--){ int a,b; cin>>a>>b; if(a==1){ r++; } if(b==1){ l++; }if(a==b){ r--; } } cout<<r*l; }

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

triangle.cpp: In function 'int main()':
triangle.cpp:5:26: error: 'r' was not declared in this scope
    5 |         cin>>n;int ans=0;r=0,l=0;
      |                          ^
triangle.cpp:5:30: error: 'l' was not declared in this scope
    5 |         cin>>n;int ans=0;r=0,l=0;
      |                              ^