목록Algorithm/일일알고리즘 (14)
:: ADVANCE ::
109일차 1. 3단계 반복문 hangover http://183.106.113.109/30stair/hangover/hangover.php?pname=hangover 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include using namespace std; int main(void) { double in, sum = 0.0, temp; int i; cin >> in; for(i = 2; sum
106일차 1. 7단계 다단계 배열 lab http://183.106.113.109/30stair/lab/lab.php?pname=lab 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 #include using namespace std; int table[110][110]; int point[110]; int main(void) { int n, i, j, max = 0, who; cin >> n; for(i = 0; i table[i][j]; } } for(i = n-1; i >= 0; i--) { for(j = 0; j
107일차 1. 9단계 재귀호출 upstair http://183.106.113.109/30stair/upstair/upstair.php?pname=upstair 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 #include using namespace std; int cnt; void upstair(int n, int end) { if(n == end) { cnt++; return ; } if(n > end) { return ; } upstair(n+1, end); upstair(n+2, end); return ; } int main(void) { int n; cin >> n; upstair(1..
98일차 2. 15단계 이진트리 coci_obilazak http://183.106.113.109/30stair/coci_obilazak/coci_obilazak.php?pname=coci_obilazak 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 #include using namespace std; int tree[1100]; int pow(int n) { if(n == 0) return 1; return 2*pow(n-1); } int main(void) { int n, i, temp = 0; cin >> n; n = pow(n); for(i = 1; ..
98일차 1. 8단계 함수 mgcd http://183.106.113.109/30stair/mgcd/mgcd.php?pname=mgcd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 #include using namespace std; int number[110]; int result; void gcm(int m, int n) { int temp; if(m == n) { result = m; return ; } if(n > m) { temp = n; n = m; m = temp; } gcm(n, m-n); } int main(void) { int n, i; c..
97일차 1. 8단계 함수 self_number http://183.106.113.109/30stair/self_num/self_num.php?pname=self_num 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 #include using namespace std; int table[11000]; void func(int lim) { int n, i, dx; for(i = 1; i
95일차 1. omok 9단계 재귀 http://183.106.113.109/30stair/omok/omok.php?pname=omok 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 10..
http://183.106.113.109/30stair/cross/cross.php?pname=cross 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 #include using namespace std; int abs(int n) { if(n > n1 >> n2 >> m1 >> m2; if(n1 > n2) { int temp; temp = n2; n2 = n1; n1 = temp; } if(n1
http://183.106.113.109/30stair/sprime/sprime.php?pname=sprime super prime 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 #include using namespace std; int check_prime(int n) { int i; if(n == 1) return 0; for(i = 2; i*i
[91.1] 16_75 eratosthenes http://183.106.113.109/30stair/eratosthenes/eratosthenes.php?pname=eratosthenes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 #include using namespace std; int number[10000]; void makenum(int n) { int i; for(i = 2; i