문제 링크입니다: https://www.acmicpc.net/problem/9299
9299번: Math Tutoring
For each case, output the line “Case x:” where x is the case number, on a single line. The output polynomial is to be formatted in the same manner as the input: the first value being the highest polynomial, and the successive values being the coefficie
www.acmicpc.net
간단한 구현 문제였습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
int T; | |
cin >> T; | |
for (int t = 1; t <= T; t++) | |
{ | |
int n; | |
cin >> n; | |
cout << "Case " << t << ": "; | |
cout << n - 1 << " "; | |
for (int i = n; i >= 0; i--) | |
{ | |
int num; | |
cin >> num; | |
if (i == 0) | |
{ | |
continue; | |
} | |
cout << i * num << " "; | |
} | |
cout << "\n"; | |
} | |
return 0; | |
} |


개발환경:Visual Studio 2017
지적, 조언, 질문 환영입니다! 댓글 남겨주세요~
반응형
'알고리즘 > BOJ' 카테고리의 다른 글
백준 9316번 Hello Judge (0) | 2021.07.06 |
---|---|
백준 9310번 Arithmetic and Geometric Sums (0) | 2021.07.05 |
백준 9298번 Ant Entrapment (0) | 2021.07.04 |
백준 9297번 Reducing Improper Fractions (0) | 2021.07.04 |
백준 9295번 주사위 (0) | 2021.07.04 |