제출 #798443

#제출 시각아이디문제언어결과실행 시간메모리
798443XJP12Best Place (NOI17_bestplace)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
int main(){
	int n;
	vector<pair<int,int>> v;
	for(int i=0; i<n; i++){
		int a,b;
		cin>>a,b;
		v.push_back({a,b});
	}
	cout<<a<<" "<<b<<endl;
}

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

bestplace.cpp: In function 'int main()':
bestplace.cpp:11:11: warning: right operand of comma operator has no effect [-Wunused-value]
   11 |   cin>>a,b;
      |           ^
bestplace.cpp:14:8: error: 'a' was not declared in this scope
   14 |  cout<<a<<" "<<b<<endl;
      |        ^
bestplace.cpp:14:16: error: 'b' was not declared in this scope
   14 |  cout<<a<<" "<<b<<endl;
      |                ^