https://www.acmicpc.net/problem/1075
#include <iostream>
#include <map>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
// freopen("input.txt", "r", stdin);
int N, F;
int answer = 0;
cin >> N >> F;
// 뒤 두 자리를 먼저 00으로 바꾸기
N /= 100;
N *= 100;
// 답은 0~99
while((N+answer) % F != 0 && answer < 100) answer ++;
if (answer < 10) cout << "0" + to_string(answer) << endl;
else cout << answer << endl;
return 0;
}
'백준' 카테고리의 다른 글
[C++] 백준 투명 (0) | 2024.06.18 |
---|---|
[C++] 백준 분산처리 (1) | 2024.06.16 |
[C++] 백준 DNA 해독 (1) | 2024.01.30 |
[C++] 백준 평균은 넘겠지 (0) | 2024.01.23 |
[C++] 백준 스티커 (1) | 2024.01.22 |