분류 전체보기93 n까지의 합 #include int func1(int k) { int i, r = 0; for(i=k;i>0;i--) r+=i; return r; } int func2(int k) { if(k 2019. 9. 2. recurse #include void recurse2(int y); void recurse1(int x); int main(void) { recurse1(9); return 0; } void recurse1(int x) { if(x) recurse2(x-1); printf("%d", x); } void recurse2(int y) { printf("*"); if(y) recurse(y-1); } /* *****13579 -------------------------------- Process exited after 0.0163 seconds with return value 0 계속하려면 아무 키나 누르십시오 . . . */ 2019. 8. 31. bmp 이미지 프로세싱 //1024*768, 24bit(2의 24승으로 색 표현), bmp file only #include #define W 1024 #define H 768 #define head 54 FILE *fp1, *fp2; //파일 처리용 구조체 변수 unsigned char R[H][W], G[H][W], B[H][W]; //색상 데이터 저장용 void bmp_open(char s[20], char t[20]) { fp1 = fopen(s, "rb"); //바이너리 읽기 모드로 파일 열기 2진법으로 읽음 fp2 = fopen(t, "wb"); //바이너리 쓰기 모드로 파일 열기 쓸 때도 2진 코드 } void bmp_close() { fclose(fp1); fclose(fp2); } void head_copy().. 2019. 8. 31. recur #include int recur(int n) { int s; if(n 2019. 8. 30. reverse #include void reverse(char a[], int s, int d) { if(s 2019. 8. 30. 이전 1 2 3 4 5 6 7 8 ··· 19 다음