#include <stdio.h>
#include <stdlib.h>
int main(){
int Y;
while(scanf("%d",&Y)){
if(Y%4 > 0){
printf("平年\n");
}
else if(Y%4 == 0){
printf("閏年\n");
}
else if(Y%100 == 0){
printf("平年\n");
}
else if(Y%400 == 0){
printf("閏年\n");
}
break;
}
return 0;
}
測試給AC
解答說第二行錯QQ
#include
#include
int main(){
int Y;
while(scanf("%d",&Y)){
if(Y%4 > 0){
printf("平年\n");
}
else if(Y%4 == 0){
printf("閏年\n");
}
else if(Y%100 == 0){
printf("平年\n");
}
else if(Y%400 == 0){
printf("閏年\n");
}
break;
}
return 0;
}
測試給AC
解答說第二行錯QQ
#include <stdio.h>
#include <stdlib.h>
int main(){
int Y;
while(scanf("%d",&Y)){
if(Y%400 == 0){
printf("平年\n");
}
else if(Y%100 == 0){
printf("閏年\n");
}
else if(Y%4 > 0){
printf("平年\n");
}
else if(Y%4 == 0){
printf("閏年\n");
}
break;
}
return 0;
}
要先判別400and100
#include
#include
int main(){
int Y;
while(scanf("%d",&Y)){
if(Y%4 > 0){
printf("平年\n");
}
else if(Y%4 == 0){
printf("閏年\n");
}
else if(Y%100 == 0){
printf("平年\n");
}
else if(Y%400 == 0){
printf("閏年\n");
}
break;
}
return 0;
}
測試給AC
解答說第二行錯QQ
#include
#include
int main(){
int Y;
while(scanf("%d",&Y)){
if(Y%400 == 0){
printf("平年\n");
}
else if(Y%100 == 0){
printf("閏年\n");
}
else if(Y%4 > 0){
printf("平年\n");
}
else if(Y%4 == 0){
printf("閏年\n");
}
break;
}
return 0;
}
要先判別400and100
謝謝
但我用你的解答還是沒過:((
#include
#include
int main(){
int Y;
while(scanf("%d",&Y)){
if(Y%4 > 0){
printf("平年\n");
}
else if(Y%4 == 0){
printf("閏年\n");
}
else if(Y%100 == 0){
printf("平年\n");
}
else if(Y%400 == 0){
printf("閏年\n");
}
break;
}
return 0;
}
測試給AC
解答說第二行錯QQ
#include
#include
int main(){
int Y;
while(scanf("%d",&Y)){
if(Y%400 == 0){
printf("平年\n");
}
else if(Y%100 == 0){
printf("閏年\n");
}
else if(Y%4 > 0){
printf("平年\n");
}
else if(Y%4 == 0){
printf("閏年\n");
}
break;
}
return 0;
}
要先判別400and100
謝謝
但我用你的解答還是沒過:((
#include <stdio.h>
#include <stdlib.h>
int main(){
int Y;
while(scanf("%d",&Y)){
if(Y%400 == 0){
printf("閏年\n");
}
else if(Y%100 == 0){
printf("平年\n");
}
else if(Y%4 > 0){
printf("平年\n");
}
else if(Y%4 == 0){
printf("閏年\n");
}
break;
}
return 0;
}