Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- SDK
- collect2.exe
- StableDiffusion #Unity #Inspector #Custom #WordRank
- Check that the SDK is installed properly
- 코딩 테스트 #leetcode #two sum #coding test
- NDK
- AndroidStudio
- ue5
- vscode
- LNK1168
- 이미지 엑스 박스
- jpg
- 1d returned
- Android is not a valid platform
Archives
- Today
- Total
안경말이
[25304 c++] 백준 영수증 본문
cin은 공백(space, enter..) 기준으로 끊어 입력을 받습니다.
따라서, 2000 5를 각각 a,b에 입력받고 싶을 때 cin>>a>>b로 사용하면 되며, 공백까지 입력받고 싶을 때는 getline을 사용하면 됩니다.
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int x,n,a,b;
int rest=0;
cin>>x>>n;
for(int i=0; i<n; i++){
cin>>a>>b;
rest += a*b;
}
if(rest == x)cout<<"Yes";
else cout<<"No";
}
'Coding Test > Baekjoon' 카테고리의 다른 글
[8393 c++] 백준 합 (1) | 2022.10.26 |
---|---|
[10818 c++] 백준 10818번 최소, 최대 (2) | 2022.10.23 |
[1978 c++] 백준 1978번 소수 찾기 (0) | 2022.10.22 |
Comments