ํฐ์คํ ๋ฆฌ ๋ทฐ
          Programming/์๋ฃ๊ตฌ์กฐ
          
        [์ฌ๊ท] ์ต๋๊ฐ ๊ตฌํ๊ธฐ, ํ๋ ธ์ด์ ํ, ์ ํด๋ฆฌ๋ ํธ์ ๋ฒ(์ต๋๊ณต์ฝ์ ๊ตฌํ๊ธฐ)
ํด๋์๊ทธ 2021. 4. 21. 03:09๋ฐ์ํ
    
    
    
  1.

์ฝ๋:
int _max(int a[], int m, int b) {
	if (b == 0)
		return m;
	if (a[b - 1] >= m)
		m = a[b - 1];
	return _max(a, m, b - 1);
}
int main() {
	int n, x[20];
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &x[i]);
	}
	int m = 0;
	printf("%d", _max(x, m, n));
}
2.

์ฝ๋:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int hanoi(int n, char A, char B, char C) {
	if (n > 1) {
		hanoi(n - 1, A, C, B);
		printf("%c %c\n", A, C);
		hanoi(n - 1, B, A, C);
	}
	else
		printf("%c %c\n", A, C);
}
int main() {
	int n;
	scanf("%d", &n);
	hanoi(n, 'A', 'B', 'C');
}
3.

์ฝ๋:
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int gcd(int x, int y) {
	if (y == 0)
		return x;
	else
		return gcd(y, x % y);
}
int main() {
	int x, y;
	scanf("%d %d", &x, &y);
	printf("%d", gcd(x, y));
}
4. ์ดํดX

์ฝ๋:
#include<stdio.h>
#include<string.h>
int check(char* str, int len, char c) {
	int chk = 0, i = 0;
	if (len != 0) {
		if (*(str + strlen(str)-1 - len) == c) {
			return 1 + check(str, len - 1, c);
		}
		else {
			return 0 + check(str, len - 1, c);
		}
	}
	else {
		if (*(str + strlen(str) - 1) == c)
			return 1;
		else
			return 0;
	}
}
int main() {
	char str[1000];
	gets(str);
	char c;
	scanf("%c", &c);
	printf("%d", check(str, strlen(str)-1, c));
}๋ฐ์ํ
    
    
    
  'Programming > ์๋ฃ๊ตฌ์กฐ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
                      ๊ณต์ง์ฌํญ
                      
                  
                
                  
                  
                    ์ต๊ทผ์ ์ฌ๋ผ์จ ๊ธ
                    
                
                  
                  
                    ์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
                    
                
                  
                  - Total
- Today
- Yesterday
                    ๋งํฌ
                    
                
                  
                  
                    TAG
                    
                
                  
                  - ์ปดํจํฐ๋น์ 
- lgaimers
- ์ฝ๋ฉ์๋ฌ
- ํ์ด์ฌ
- ์ฝ๋ฉ๊ณต๋ถ
- AIRUSH
- ๋ ผ๋ฌธ
- ํ์ด์ฌ์ฝํ 
- Paper review
- dreambooth
- ๋ ผ๋ฌธ๋ฆฌ๋ทฐ
- CLOVAX
- Gaussian Splatting
- ํ๋ก๊ทธ๋๋จธ์ค
- AI์ปจํผ๋ฐ์ค
- MYSQL
- SKTECHSUMMIT
- C์ธ์ด
- AIRUSH2023
- ์คํ ์ด๋ธ๋ํจ์ 
- Aimers
- gs๋ ผ๋ฌธ
- ๋๋ฆผ๋ถ์ค
- ์ฝํ ์ค๋น
- ํ ํฌ์๋ฐ
- 3d-gs
- 2d-gs
- gan
- SQL
- ๋ ผ๋ฌธ์ฝ๊ธฐ
| ์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ | 
|---|---|---|---|---|---|---|
| 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 | 
                    ๊ธ ๋ณด๊ดํจ
                    
                ๋ฐ์ํ