Wrong Answer
/in/foo.c: In function 'main': /in/foo.c:12:10: warning: too many arguments for format [-Wformat-extra-args] printf("%dth",year,sum); ^~~~~~
代码
#include <stdio.h>
int main()
{
int year,month,day;
int judge,i;
int sum=0;
int date[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}};
scanf("%d %d %d",&year,&month,&day);judge=(year%4==0)||(year%400==0 && year%100!=0);
for(i=0;i<month-1;i++)
sum+=date[judge][i];
sum+=day;
printf("%dth",year,sum);
return 0;
}
信息
- 递交者
- 类型
- 递交
- 题目
- 给出年、月、日,计算该日是该年的第几天
- 题目数据
- 下载
- 语言
- C
- 递交时间
- 2018-06-17 18:59:39
- 评测时间
- 2018-06-17 18:59:39
- 评测机
- 分数
- 0
- 总耗时
- 13ms
- 峰值内存
- 256.0 KiB