본문 바로가기

전체 글

(2344)
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 10103번:주사위 게임 답 1234567891011121314151617#include using namespace std;int main() { int n,as=100,bs=100; cin >> n; while (n--) { int a, b; cin >> a >> b; if (a > b) bs -= a; else if (a
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 4504번:배수 찾기 답 12345678910111213141516#include using namespace std;int main() { int n; cin >> n; while (1) { int x; cin >> x; if (x == 0) { break; } if (x % n == 0) cout
(C++) - 백준(BOJ) 5361번 : 전투 드로이드 가격 답 #include using namespace std; int main() { double a[5] = { 350.34,230.9,190.55,125.3,180.9 }, sum; int n; cin >> n; while (n--) { sum = 0; for (int i = 0; i > x; sum += a[i] * x; } printf("$%.2f\n",sum ); } }
(C++) - 백준(BOJ) 10101번 : 삼각형 외우기 #include using namespace std; int main() { int a[3], sum=0; for (int i = 0; i > a[i]; sum += a[i]; } if (sum != 180) { cout
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 11656번:접미사 배열 답 1234567891011121314151617#include #include #include #include #include using namespace std;int main() { string s; cin >> s; int ss = s.size(); vector a; for (int i = 0; i
C++(씨쁠쁠)(cplusplus)-백준(baekjoon)(BaekJoon)코딩 10699번:오늘 날짜 답 1234567891011121314151617#define _CRT_SECURE_NO_WARNINGS#include #include char* timeToString(struct tm *t);int main(void) { struct tm *t; time_t timer; timer = time(NULL); t = localtime(&timer); printf("%s\n", timeToString(t)); return 0;}char* timeToString(struct tm *t) { static char s[20]; sprintf(s, "%04d-%02d-%02d", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday); return s;}Colored by Color Scr..
(C++) - 백준(BOJ)코딩 10818번 : 최소, 최대 www.acmicpc.net/problem/10818 10818번: 최소, 최대 첫째 줄에 정수의 개수 N (1 ≤ N ≤ 1,000,000)이 주어진다. 둘째 줄에는 N개의 정수를 공백으로 구분해서 주어진다. 모든 정수는 -1,000,000보다 크거나 같고, 1,000,000보다 작거나 같은 정수이다. www.acmicpc.net loop를 사용해 최소, 최대를 찾아 출력하는 문제였습니다. Code #include using namespace std; int a[1000001], b = -1000001, s = 1000001,n; int main() { cin >> n; for (int i = 0; i > a[i]; if (b ..
(C++) - 백준(BOJ) 3040번 : 백설 공주와 일곱 난쟁이 #include using namespace std; int main() { int d[10],c[10],a=0,b,sum;//a,b는 가짜 난쟁이 for (int i = 1; i > d[i]; for(int r = 1; r