1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include <stdio.h> int main(void) { char line[100] = ""; char line2[100] = ""; printf("¹®ÀÚ¿À» ÀÔ·ÂÇϽÿÀ: "); gets_s(line, sizeof(line)); int k = 0; for (int i = 0; line[i] != '\0'; ++i) { while (line[i] >= 'A' && line[i] <= 'z') { line2[k++] = line[i++]; } } line2[k] = '\0'; printf("Ãâ·Â ¹®ÀÚ¿: %s\n", line2); return 0; } | cs |