| 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 | #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> void printRLE(char str[]) { int n = strlen(str); for (int i = 0; i < n; i++) { int count = 1; while (i < n - 1 && str[i] == str[i + 1]) { count++; i++; } printf("%d%c", count, str[i]); } printf("\n\n"); } int main(void) { char s[100]; printf("문자열을 입력하시오: "); gets_s(s, 100); printRLE(s); return 0; } | cs |
모범답안에는 복구하는 프로그램이 없음
복구하는 프로그램은 추가구현에 구현 (암호는 수업시간에 알려준 암호)


C프로그래밍(프로그래밍언어) 실습게시판