끄적끄적 코딩
article thumbnail
[C++] 백준 8393번 합
알고리즘 2019. 3. 5. 13:31

for문을 이용해서 문제를 풀었습니다. 입력한 값이 될때까지 i를 증가하면서 더합니다. #include #include using namespace std; int main(int argc, char *argv[]) { int x=0, value=0; cin >> x; for(int i=0; i

article thumbnail
[C++] 백준 1924번 2007년
알고리즘 2019. 3. 5. 13:27

month에 월, d에 일을 입력 받습니다. 그리고 d에 month를 day로 변환한값을 더한 후 switch문으로 요일을 판별합니다. #include using namespace std; int main(int argc, char *argv[]) { int m[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; int d = 1; int month = 1; cin >> month; cin >> d; for (int i = 0; i < month; ++i) { d += m[i]; } switch (d % 7) { case 0: cout

article thumbnail
[C++] 백준 2441번 별 찍기 - 4
알고리즘 2019. 3. 5. 02:04

2중 for문을 이용해서 문제를 풀었습니다. #include using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; for (int i = 0; i = i) { cout

article thumbnail
[C++] 백준 2440번 별 찍기 - 3
알고리즘 2019. 3. 5. 02:04

2중 for문을 이용해서 문제를 풀었습니다. #include using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; for (int i = 0; i i; j--) { cout

article thumbnail
[C++] 백준 2439번 별 찍기 - 2
알고리즘 2019. 3. 5. 02:02

for문을 이용해서 문제를 풀었습니다. #include using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; for (int i = 2; i 0; j--) { if (j < i) { cout

article thumbnail
[C++] 백준 2438번 별 찍기 - 1
알고리즘 2019. 3. 5. 01:55

for문을 이용해서 문제를 풀었습니다. #include using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; for(int i=1; i

article thumbnail
[C++] 백준 2739번 구구단
알고리즘 2019. 3. 5. 01:44

for문을 이용해서 문제를 풀었습니다. #include using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; for(int i=0; i

article thumbnail
[C++] 백준 2742번 기찍 N
알고리즘 2019. 3. 5. 01:42

for문을 이용해서 풀었습니다. #include using namespace std; int main(int argc, char *argv[]) { int n; cin >> n; for(int i=0; i

검색 태그