首页 > 试题广场 >

今年的第几天?

[编程题]今年的第几天?
  • 热度指数:35162 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 64M,其他语言128M
  • 算法知识视频讲解
输入年、月、日,计算该天是本年的第几天。

输入描述:
包括三个整数年(1<=Y<=3000)、月(1<=M<=12)、日(1<=D<=31)。


输出描述:
输入可能有多组测试数据,对于每一组测试数据,
输出一个整数,代表Input中的年、月、日对应本年的第几天。
示例1

输入

1990 9 20
2000 5 1

输出

263
122
头像 帅呆呆~
发表于 2022-03-05 10:39:55
">#include<cstdio> using namespace std; int dayTable[2][13]= { {0,31,28,31,30,31,30,31,31,30,31,30,31}, //平年每月天数 {0,31,29,31,30,31,30,31, 展开全文
头像 渺小小螃蟹
发表于 2021-05-07 17:37:47
include<stdio.h> include<stdbool.h> int daytab[2][13] ={ {0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,3 展开全文
头像 aaaawei
发表于 2021-01-06 15:12:39
注意判断闰年就好了 预处理能用空间换时间。#include<iostream>#include<cstdio>using namespace std;</cstdio></iostream> int model[2][13]={{0,31,28,31 展开全文
头像 MrMello
发表于 2023-03-23 20:07:35
#include <stdio.h> int main(){ int Month[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int year, month, day; while (scanf( 展开全文
头像 乌龟狗的齐天大圣
发表于 2023-02-15 18:59:45
#include <stdio.h> int main(){ int year,month,day; int list1[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int list2[13]={0,31,29,31 展开全文
头像 philos
发表于 2021-02-04 20:59:43
思路 这道题无非就是区分不同月份天数不一样,以及闰年、平年的区别而已。 #include<iostream> using namespace std; int main(){ int year, month, day; int days[2][13]={{0,31,2 展开全文
头像 果踌
发表于 2023-02-02 09:09:04
#include<cstdio> int main(){ int year,month,day; int mon[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; while(scanf("%d%d%d",&year,&mo 展开全文
头像 这破程序员一秒都不想当了
发表于 2024-03-27 11:59:05
#include <iostream> using namespace std; int timevault[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}}; i 展开全文
头像 bigbigcake
发表于 2024-03-16 15:09:57
#include <iostream> using namespace std; int main() { int year,month,day; while(cin>>year>>month>>day){ int ar 展开全文
头像 奔放的芭乐在做ppt
发表于 2023-04-22 20:29:43
#include<cstdio> #include<iostream> using namespace std; int main() { int y,m,d; int sum1=0; scanf("%d %d %d",&y,&m,&d); int day[13]={ 展开全文

问题信息

难度:
174条回答 18813浏览

热门推荐

通过挑战的用户

查看代码