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

피너클의 it공부방

백준 17256 달달함이 넘쳐흘러 (c++) : 피너클 본문

백준

백준 17256 달달함이 넘쳐흘러 (c++) : 피너클

피너클 2022. 5. 26. 19:23
728x90
반응형

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

 

17256번: 달달함이 넘쳐흘러

첫째 줄에 케이크 수 a를 구성하는 자연수 a.x, a.y, a.z 가 차례대로 주어진다. (1 ≤ a.x, a.y, a.z ≤ 100) 둘째 줄에 케이크 수 c를 구성하는 자연수 c.x, c.y, c.z 가 차례대로 주어진다. (1 ≤ c.x, c.y, c.z

www.acmicpc.net

단순한 수학문제다.

문제에 나온 식을 거꾸로 해서 계산해 출력하면된다.

#include <iostream>

using namespace std;

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

	int ax, ay, az;
	int cx, cy, cz;

	cin >> ax >> ay >> az;
	cin >> cx >> cy >> cz;

	cout << cx - az << ' ' << cy / ay << ' ' << cz - ax << endl;
}

전체코드다.

728x90
반응형
Comments