Notice
Recent Posts
Recent Comments
Link
250x250
«   2025/04   »
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
Archives
Today
Total
관리 메뉴

피너클의 it공부방

백준 2720 세탁소 사장 동혁 (c++) : 피너클 본문

카테고리 없음

백준 2720 세탁소 사장 동혁 (c++) : 피너클

피너클 2024. 11. 8. 01:45
728x90
반응형

https://www.acmicpc.net/problem/2720 

 

단순 수학 문제다.

#include <iostream>
#include <algorithm>

using namespace std;

int test, c;
int Quarter = 25;
int Dime = 10;
int Nickel = 5;
int Penny = 1;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> test;
	while (test-- > 0) {
		cin >> c;
		cout << c / Quarter << ' ';
		c %= Quarter;
		cout << c / Dime << ' ';
		c %= Dime;
		cout << c / Nickel << ' ';
		c %= Nickel;
		cout << c / Penny << ' ';
		c %= Penny;
	}
}


전체코드다.

728x90
반응형
Comments