알고리즘(139)
-
[백준 5032번] 탄산 음료
소스코드123456789101112131415#include using namespace std; int main() { int e, f, c, cnt,empty; cin >> e >> f >> c; cnt = (e+f)/c; empty = cnt + (e + f) % c; while (empty/c){ cnt += (empty / c); // 바꾼 빈병 empty = ((empty/c) + (empty % c)); // 못바꾼 빈병 } cout
2018.01.10 -
[백준 8320번] 직사각형을 만드는 방법
소스코드123456789101112#include using namespace std; int main() { int n,r=0; cin >> n; for (int i = 1; i
2018.01.10 -
[백준 1159번] 농구 경기
소스코드1234567891011121314151617181920212223#include using namespace std; int n, chk[26];char name[151][31];bool flag = true; int main() { cin >> n; for (int i = 0; i > name[i]; chk[(int)name[i][0]-97]++; } for (int i = 0; i = 5) { cout
2018.01.10 -
[백준 12791번] Starman
소스코드12345678910111213141516171819202122232425262728#include #include using namespace std; struct a {int year;string title;}; a album[26] = { 1967, "DavidBowie", 1969, "SpaceOddity", 1970, "TheManWhoSoldTheWorld", 1971, "HunkyDory", 1972, "TheRiseAndFallOfZiggyStardustAndTheSpidersFromMars", 1973, "AladdinSane", 1973, "PinUps", 1974, "DiamondDogs", 1975, "YoungAmericans", 1976, "StationToStation"..
2018.01.10 -
[백준 5596번] 시험 점수
소스코드12345678910#include using namespace std; int main() { int s=0,t=0, d; for (int i = 0; i > d; s += d; } for (int i = 0; i > d; t += d; } cout
2018.01.10 -
[백준 12790번] Mini Fantasy War
소스코드123456789101112131415#include using namespace std; int main() { int t, a, b, c, d, e, f, g, h; cin >> t; while (t--) { cin >> a >> b >> c >> d >> e >> f >> g >> h; a += e, b += f, c += g, d += h; a = a
2018.01.10