#include<stdio.h> #include<stdlib.h> int main() { int y; while(scanf("%d",&y)) { if(y%4==0&&y%100!=0||y%400==0) { printf("閏年\n"); } else { printf("平年\n"); } } return 0; }明明編譯結果是對的,為什麼TLE?
while(scanf("%d",&y))
改成while(scanf("%d",&y)!=EOF)