왜 틀린건지 모르겠습니다

baio2033 Reply 7 years 8 weeks ago
sample input 집어넣으면 sample output 그대로 나오는데 뭐가 문젠지 모르겠습니다. -------------------------------------------------------------------------------- #include <stdio.h> int main() { char c; char str[1000] = { 0 }; int num = 0; c = getchar(); while (c != EOF) { if (c == 10) { if (num < 32) { for (int i = 0; i < num; i++) printf("%c", str[i]); printf("\n"); } memset(str, 0, 1000); num = 0; c = getchar(); } else { str[num++] = c; c = getchar(); } } return 0; }
withcs1 Reply 7 years 8 weeks ago
https://withcs.net/t/2489