본문 바로가기

School class

(6)
c언어)선형탐색, 이진탐색 [수업] 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 int linsearch(int a[], int size, int target){ for (int i = 0; i cs
C언어) 회문 확인[수업] 회문이란 거꾸로 읽어도 같은거이다. 예를 들어 "SOS", "level"같은것이 있다. 실행결과 예1 Input : level output : 1 실행결과 예2 Input : baby output : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #include #include int main() { int flag = 0; char a[100] = { 0 }; printf("Input : "); scanf("%s", a); int len = strlen(a); for (int i = 0;i cs
C언어)문자열 포함 확인[수업] [문제] 공백을 포함하지 않는 문자열 두 개를 입력받아, 배열 a와 b에 저장 한후, 문자열 b가 문자열 a에 포함되어 있는지 알아내는 프로그램을 작성하라. 조건1) 첫 번째 문자열(a)의 길이를 출력. 조건2) 문자열 b가 문자열 a에 포함되어 있는 문자열이면 1을, 그렇지 않으면 0을 출력. 조건3) 입력받은 문자열 a의 길이는 최대 50이고, b의 길이는 최대 10이다. 조건4) 문자열 처리 내장함수는 사용하지 않는다. 실행결과 예1 Input(a) : sunrin Input(b) : high Output : 6 0 실행결과 예2 Input(a) : sunrin Input(b) : rin Output : 6 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2..
C언어) 삽입정렬 수업 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 #include int main() { int arr[6] = { 3, 7, 2, 5, 1, 4 }; int i, j; int temp; int length = sizeof(arr) / sizeof(int); for (i = 0; i temp) { arr[j + 1] = arr[j]; j = j - 1; } arr[j + 1] = temp; } for (i = 0; i
C언어)버블정렬 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 #include #define n 5 void selection(int a[]){ int temp; for (int i = 0; i
c언어) 선택정렬 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 #include #define n 5 void out(int a[]){ for (int i = 0; i

/*스크롤 인디케이터 시작*/ .header { position: absolute; top: 0; z-index: 1; width: 100%; background-color: #fff; } .progress-container { width: 100%; height: 4px; background: #f6f6f6; } .progress-bar { height: 4px; background: #6C6C6C; width: 0%; } /*스크롤 인디케이터 종료*/ /*왼쪽, 좌측 밑의 이미지 추가 시작*/ /*가로의 길이가 1510일때까지는 보여라*/ @media screen and (min-width:1500px) { .main_ad { display:visible; position: absolute; left: 0px; bottom: 80px; cursor: pointer; z-index: 11; } } /*가로의 길이가 1511일까지는 보이지 말아라*/ @media screen and (max-width:1510px) { .main_ad { display:none; position: absolute; left: 0px; bottom: 80px; cursor: pointer; z-index: 11; } } /*왼쪽, 좌측 밑의 이미지 추가 종료*/ /*이웃추가버튼 추가 시작*/ @media screen and (min-width:500px) { .add_adBanner { display:visible; } } @media screen and (max-width:510px) { .add_adBanner { display:none; } } .add_adBanner ul { position: absolute; left: 10px; bottom: 22px; cursor: pointer; z-index: 12; } .add_adBanner li { margin : 0 0 0 0; padding : 0 0 0 0; border : 0; float : left; } /*이웃추가버튼 추가 종료*/