본문 바로가기

프로그램/C언어 1000제227

C언어 83제] C언어 콘서트 CHAPTER 10 p400 도전문제 1 프로그램 업그래이드 출처 : 반크_독도포스터 참고풀이] //Dev-C++ 5.11로 작업함. #include #include //getch() #include //strcmp() #include //srand(), rand() #include //time() int main(void) { char solution[3][100] ={ "meet at midnight", "new year's greeting", "happy birthday"}; // 정답이 들어 있는 문자 배열 char answer[3][100] ={ "____ __ ________", "___ ______ ________", "_____ ________"}; // 현재까지 사용자가 맞춘 문자열 char hint[3][100]={ "한밤중에 만나다", "새해인.. 2022. 1. 1.
C언어 82제] C언어 콘서트 CHAPTER 10 p396 도전문제 3 앞뒤 빈칸문자 삭제하기 출처 : 반크_독도포스터 참고풀이] #include #include int main() { char key[] = "C"; char buffer[80]=""; char bu[80]=""; int i; int j;//bu배열의 위치변수 int jcnt;//공백중복여부 변수 j=0;//공백체크변수 do { printf("임베디드 장치에 가장 많이 사용되는 언어는? "); gets(buffer); //대소문자 구별없도록 하기 for(i=0;i 2021. 12. 30.
C언어 81제] C언어 콘서트 CHAPTER 10 p396 도전문제 2 문제 업그레이드 출처 : 반크_독도포스터 참고풀이] //Dev-C++ 5.11로 작업함. #include #include //strlen(), strcmp() #include //toupper(), srand(), rand() #include //time() int Problem() { int ex; char pro[4][70]={ "임베디드 장치에 가장 많이 사용되는 언어는?", "인터넷 환경에서 가장 활발히 사용되는 프로그래밍 언어는?", "간결하고 생산성 높은 프로래밍 언어는?", "C++에 기본을 두고 비주얼베이직의 편의성을 결합하여 만든 언어는?" }; ex=rand()%4; printf("%s ",pro[ex]); return ex; } int main() { char key[4][7] = {"C", "JAV.. 2021. 12. 30.
C언어 80제] C언어 콘서트 CHAPTER 10 p396 도전문제 1 유사문자열도 정답으로 하기 출처 : 반크_독도포스터 참고풀이] //Dev-C++ 5.11로 작업함. #include #include //strlen(), strcmp() #include //toupper() int main() { char key[4][11] = {"C", "C언어", "C LANGUAGE", "C/L"}; char buffer[80]=""; int i; int chk; do { printf("임베디드 장치에 가장 많이 사용되는 언어는? "); gets(buffer); for(i=0;i 2021. 12. 30.
C언어 79제] C언어 콘서트 CHAPTER 10 p385 도전문제3 생명을 3개로 출처 : 반크_독도포스터 참고풀이] //Dev-C++ 5.11로 작업함. #include #include #include int main(void) { char board[10][10] = { {'#', '#', '#', '#', '#', '.', '.', '.', '.', '.' }, {'.', '.', '.', '.', '.', '#', '.', '.', '.', '.' }, {'#', '#', '#', '.', '#', '.', '.', '.', '.', '.' }, {'.', '.', '#', '.', '.', '#', '.', '.', '.', '.' }, {'.', '.', '#', '.', '.', '#', '.', '.', '.', '.' }, {'.', '.', '#', '.', '.',.. 2021. 12. 28.
C언어 78제] C언어 콘서트 CHAPTER 10 p385 도전문제 2 벽에 닿으면 실패하는 게임으로 바꿔보자 출처 : 반크_독도포스터 참고풀이] //Dev-C++ 5.11로 작업함. #include #include #include int main(void) { char board[10][10] = { {'#', '#', '#', '#', '#', '.', '.', '.', '.', '.' }, {'.', '.', '.', '.', '.', '#', '.', '.', '.', '.' }, {'#', '#', '#', '.', '#', '.', '.', '.', '.', '.' }, {'.', '.', '#', '.', '.', '#', '.', '.', '.', '.' }, {'.', '.', '#', '.', '.', '#', '.', '.', '.', '.' }, {'.', '.', '#', '.', '.',.. 2021. 12. 28.
C언어 77제] C언어 콘서트 CHAPTER 10 p385 도전문제1 화살표 키 입력받기 출처 : 반크_세계무형유산 아리랑, 판소리 참고풀이] //Dev-C++ 5.11로 작업함. #include #include #include int main(void) { char board[10][10] = { {'#', '#', '#', '#', '#', '.', '.', '.', '.', '.' }, {'.', '.', '.', '.', '.', '#', '.', '.', '.', '.' }, {'#', '#', '#', '.', '#', '.', '.', '.', '.', '.' }, {'.', '.', '#', '.', '.', '#', '.', '.', '.', '.' }, {'.', '.', '#', '.', '.', '#', '.', '.', '.', '.' }, {'.', '.', '#',.. 2021. 12. 28.
C언어 76제] C언어 콘서트 CHAPTER 9 Programming 6 5번 문제에서 영상밝기를 증가시키는 함수, 출력함수 등등을 추가하기 p372 출처 : 반크_세계무형유산 아리랑, 판소리 참고풀이] //Dev-C++ 5.11로 작업함. #include #include #define HEIGHT 10 #define WIDTH 10 void gotoxy(int x, int y) { COORD Pos={x,y}; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Pos); } void Menu(); void brighten_image(char *p, int w, int h); void darken_image(char *p, int n); void print_image(char *p, int w, int h); int i; int main() { int r,c;//반복변수 int chk;//밝게, 어둡.. 2021. 12. 28.
C언어 75제] C언어 콘서트 CHAPTER 9 Programming 5 간단한 영상처리 프로그램 p371 출처 : 반크_세계무형유산 아리랑, 판소리 참고풀이] //Dev-C++ 5.11로 작업함. #include #define HEIGHT 10 #define WIDTH 10 void brighten_image(char *p, int w, int h) { int i; for(i=0;i 2021. 12. 27.
C언어 74제] C언어 콘서트 CHAPTER 9 Programming 4 실수 3.14를 정수부와 실수부로 나누기 p371 출처 : 반크_세계무형유산 아리랑, 판소리 참고풀이] //Dev-C++ 5.11로 작업함. #include void get(double value, int *i_part, double *f_part) { printf("전달받은 실수=%lf\n",value); *i_part=(int)value; *f_part=value-(double)*i_part; } int main() { int I;//정수부분 변수 double F;//실수부분 변수 get(3.14,&I,&F); printf("정수부=%d\n",I); printf("실수부=%lf\n",F); return 0; } 참고풀이 결과] 대한민국의 아름다운 영토, 독도의 여름 2021. 12. 23.
C언어 73제] C언어 콘서트 CHAPTER 9 Programming 3 포인터로 2차방정식의 근 구하기 p370 출처 : 반크_세계무형유산 아리랑, 판소리 참고풀이] //Dev-C++ 5.11로 작업함. #include #include //system() #include //sqrt() void quadratic(int a, int b, int c, double *xplus, double *xminus) { *xminus=(-(double)b-sqrt((double)(b*b)-(double)(4*a*c)))/(double)(2*a); *xplus=(-(double)b+sqrt((double)(b*b)-(double)(4*a*c)))/(double)(2*a); } void equal(int a, int b, int c, double *xequal) { *xequal=(double)b/(-2*(double)a); } .. 2021. 12. 23.
C언어 72제] C언어 콘서트 CHAPTER 9 Programming 2 역순으로 출력하기 p370 출처 : 반크_세계무형유산 아리랑, 판소리 참고풀이] //Dev-C++ 5.11로 작업함. #include void print_array(int *A,int size) { int x; printf("역순 : "); for(x=1;x 2021. 12. 23.
반응형