전체 글(200)
-
[백준 2935번] 소음
소스코드123456789101112131415161718192021222324252627282930313233#include using namespace std;#define swap(a,b,tmp) tmp=a; a=b; b=tmp;int main() { int aLen = 0, bLen=0,tmp; char a[2][101],b; cin >> a[0] >> b >> a[1]; while (a[0][aLen++]!='\0') {} while (a[1][bLen++] != '\0') {} if (b == '*') { cout
2018.01.10 -
[백준 2960번] 에라토스테네스의 체
소스코드12345678910111213141516171819202122232425#include using namespace std; int n,k, num[1001], cnt=0; int main() { cin >> n >> k; for (int i = 2; i
2018.01.10 -
[백준 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