wrong answer가 왜뜰까요

LeeKwanhyun Reply 7 years 35 weeks ago
#include <stdio.h> #include <string.h> int main() { int i; char arr[1001] = {0x00,}; char save[1001] = {0x00,}; while (fgets(arr,1001,stdin)) { for (i=0;i<strlen(arr);i++) save[i] = arr[strlen(arr)-1-i]; save[strlen(arr)] = arr[strlen(arr)]; printf("%s",save); for (i=0;i<1001;i++) { arr[i] = 0; save[i] = 0; } } } 왜 wrong answer 가 뜰까요...
withcs1 Reply 7 years 35 weeks ago
fgets는 eof를 받으면 null을 반환합니다