알고리즘/백준(131)
-
[백준 10798번] 세로읽기
소스코드12345678910111213141516171819#include using namespace std; int main() { char a[5][16]; for (int i = 0; i > a[i]; while (a[i][j++] != '\0') {} for (int aa = j - 1; aa
2018.01.02 -
[백준 10974번] 모든 순열
소스코드123456789101112131415161718192021222324252627282930313233#include using namespace std; bool v[10];int tmp[10]; void dfs(int num, int d, int n) { tmp[d] = num; if (d == n) { for (int i = 1; i
2017.12.26 -
[백준 1173번] 운동
소스코드12345678910111213141516171819202122232425#include using namespace std; int main() { int N, m, M, T, R; cin >> N >> m >> M >> T >> R; int cur = m, dest = 0, cnt = 0; bool flag = false; while (1) { if (dest == N){ break; } if (cur + T = m) { cur -= R, cnt++, flag = false; continue; } if (cur - R
2017.12.20 -
[백준 1051번] 숫자 삼각형
소스코드12345678910111213141516171819202122232425262728#include using namespace std; int main() { int num[52][52],n, m, r, Max=1; cin >> n >> m; r = n > m ? m : n; for (int i = 0; i a; num[i][j] = a - '0'; } } for (int i = 0; i
2017.12.16 -
[백준 7568번] 덩치
소스코드12345678910111213141516171819#include using namespace std; int n, a[3][51]; int main() { cin >> n; for (int i = 0; i > a[0][i] >> a[1][i]; for (int i = 0; i
2017.12.12 -
[백준 2231번] 분해합
소스코드123456789101112131415161718192021#include using namespace std; int cal(int num) { int sum = num; while (num!=0) { sum += num % 10; num /= 10; } return sum;} int main() { int n; cin >> n; for (int i = 1; i
2017.12.12