#define _CRT_SECURE_NO_WARNINGS 1數組
#include <stdio.h>ide
int main()
{code
int score; while(scanf("%d",&score)!=EOF) { getchar(); if(score > 100 || score < 0) { printf("Score is error!\n"); continue; } score = score / 10; switch(score) { case 10: case 9: printf("A\n"); break; case 8: printf("B\n"); break; case 7: printf("C\n"); break; case 6: printf("D\n"); break; default: printf("E\n"); break; } } return 0;
}ip
#define _CRT_SECURE_NO_WARNINGS 1get
#include <stdio.h>input
int main()
{it
int year,month,day,date,i; int days[2][12] = {{31,28,31,30,31,30,31,31,30,31,30,31}, {31,29,31,30,31,30,31,31,30,31,30,31}}; while(scanf("%d/%d/%d",&year,&month,&day)!=EOF) { getchar(); //判斷是不是閏年 date = day; if((year % 4==0 && year % 100!=0)||year % 400==0) { for(i=0; i<month-1; i++) { date += days[1][i]; } printf("%d\n",date); } else { for(i=0; i<month-1; i++) { date += days[0][i]; } printf("%d\n",date); } } return 0;
}io