프로그래밍 언어 활용난도 중상
19번 · 주관식 · 5점
다음 C 프로그램의 실행 결과를 쓰시오.
#include <stdio.h>
#include <ctype.h>
int main(void) {
char text[] = "It is 8";
for (int i = 0; text[i] != '\0'; i++) {
if (isupper((unsigned char)text[i]))
text[i] = (char)('A' + (text[i] - 'A' + 5) % 26);
else if (islower((unsigned char)text[i]))
text[i] = (char)('a' + (text[i] - 'a' + 10) % 26);
else if (isdigit((unsigned char)text[i]))
text[i] = (char)('0' + (text[i] - '0' + 3) % 10);
}
printf("%s", text);
return 0;
}