본문 바로가기

씨플플

webhacking.kr [문제 9번] 중간에 알바면접이 있어서 포스팅을 못했다. 미루고 미루던 웹해킹 9번 문제를 풀어보겠다. 9번문제 무려 900point로 전체 문제 중 두번째로 점수 배점이 높다. 해당 문제를 풀면 대략적인 다른 문제들의 난이도를 예상할 수 있을 것으로 예상된다. 문제 클릭시 다음과 같은 페이지를 보여준다. 소스코드를 확인해보자. 별다른 정보는 없지만 각 페이지가 no=1, no=2, no=3로 하이퍼링크 되어 있는 것을 확인할 수 있다. 실제 각각의 페이지를 확인해보자. 1번 페이지 2번 페이지 3번 페이지ㅓ 다음과 같은 페이지를 분석해보니. 데이터베이스에서 no일때의 각각의 id값을 가져와 화면에 뿌려주는 것으로 확인된다. 또한 no=3일때의 id값의 길이는 11로 힌트가 주어졌다. 과연 해당 가설이 맞는지 no=4.. 더보기
컴퓨터 프로그래밍 설계 과제#5_HW03 #include #include int FSM_[5][6] = { /* sign digit alfa period special EOS */ /* 상태 0 */{ 2, 1, -19, 3, -10, -12 }, /* 상태 1 */{ -13, 1, -19, 3, -14 , -1 }, /* 상태 2 */{ -15, 1, -19, 3, -14 , -11 }, /* 상태 3 */{ -13, 4, -19, -16, -14 , -11 }, /* 상태 4 */{ -13, 4, -19, -16, -14 , -1 } }; int check_state(int state_num, char input){ int state = 0; int char_state; int input_num = (int)input; if( (input_.. 더보기
컴퓨터 프로그래밍 설계 과제#5_HW02 #include #include #include void p_large_unit(int num); void p_small_unit(int num); void p_han(int num, int num2); int main(void) { char input_num[21]={0,}; int num_data[20]={0,}; int num_data_d2[5][4]={0,}; int num_length=0; scanf("%s", input_num); num_length = strlen(input_num); //printf("숫자의 길이 : %d\n", num_length); //printf("%s\n", input_num); for(int i=0; i 더보기
컴퓨터 프로그래밍 설계 과제#5_HW01 #include #include struct person { char name[50]; char phone[20]; int pay_hour; int work_hour; int total_pay; }; int main(void) { FILE *pfile = NULL; FILE *wfile = NULL; person **p_array = NULL; pfile = fopen("input.txt", "r"); wfile = fopen("output.txt", "w"); int person_num = 0; if(pfile == NULL) { printf("파일을 읽어올 수 없습니다.\n"); exit(0); } else { fscanf(pfile, "%d", &person_num); fflush(stdin); /.. 더보기
컴퓨터 프로그래밍 설계 과제#4_HW03 #include #include #include int validation_data(int tmp_arr[]); int main(void) { int test_case = 0; int data_arr[9][9] = {0,}; int tmp_arr[9] = {0,}; int check_flag = 1; int cnt = 0; scanf("%d", &test_case); for(int case_num=0; case_num < test_case; case_num++) { check_flag = 1; for(int i=0 ;i 더보기
컴퓨터 프로그래밍 설계 과제#4_HW02 #include #include #include int validation_former(char arr[], int a); int validation_latter(char arr[]); int main(void) { int chk_former = 1; int chk_latter = 1; int test_case = 0; scanf("%d", &test_case); fflush(stdin); for(int i=0; i 더보기
컴퓨터 프로그래밍 설계 과제#4_HW01 #include #include #include int main(void) { char **name; char *temp; int test_case, i, j; int check_flag=0; // 1이면 동일한 문자열이 있음, 0이면 없음 scanf("%d", &test_case); fflush(stdin); name = (char **)malloc((test_case)*4); // String의 주소값 배열 할당 //문자 배열 5개씩 동적할당 for (i=0 ; i 더보기