2019独角兽企业重金招聘Python工程师标准>>>

還好還好蛋沒有粉

/*
NAME: zfb2
LANG: C++
TASK: friday
*/#include <iostream>
#include <fstream>
#include <math.h>
using namespace std;int sun=0, mon=0, tue=0, wed=0, thu=0, fri=0, sat=0;bool
leap(int n)
{if((n%4==0&&n%100!=0)||n%400==0)return true;elsereturn false;
}void
fun(int tol)
{   switch(tol%7){case 0: sun++; break;case 1: mon++; break;case 2: tue++; break;case 3: wed++; break;case 4: thu++; break;case 5: fri++; break;case 6: sat++; break;}
}int
main()
{freopen("friday.in", "r", stdin);freopen("friday.out", "w", stdout);int N;cin>>N;int sum=0;for(int i=1900; i<=1900+N-1; i++){for(int j=1; j<=12; j++){switch(j){case 1:case 3:case 5:case 7:case 8:case 10:case 12: {fun(sum+13); sum+=31;} break;case 4:case 6:case 9:case 11: {fun(sum+13); sum+=30;} break;case 2:{if(leap(i)){fun(sum+13); sum+=29;}else{fun(sum+13); sum+=28;}    }break;}}}cout<<sat<<" "<<sun<<" "<<mon<<" "<<tue<<" "<<wed<<" "<<thu<<" "<<fri<<endl;/*int i=1900;/*while(i<=1920){cout<<i<<"    "<<leap(i)<<endl;i++;}*///cin>>N;return 0;
}

转载于:https://my.oschina.net/dianpaopao/blog/86878

USACO 1.0_Friday the Thirteenth相关推荐

  1. USACO黑色星期五Friday the Thirteenth

    黑色星期五Friday the Thirteenth 嗯,虽然很水,但细节是真的多. 我闰年判断错了而且while循环都忘了(伤心) 题目描述 13号又是一个星期五.13号在星期五比在其他日子少吗?为 ...

  2. USACO 1.1 Friday the Thirteenth

    题目来源:USACO 1.1 原题目: Friday the Thirteenth Is Friday the 13th really an unusual event? That is, does ...

  3. USACO—1.1.3 Friday the Thirteenth 黑色星期五

    题目描述: 1.1.3 Friday the Thirteenth 黑色星期五 (friday.pas/c/cpp) 13号又是一个星期五.13号在星期五比在其他日子少吗?为了回答这个问题,写一个程序 ...

  4. USACO Training Section 1.1黑色星期五Friday the Thirteenth

    题目描述 13号又是一个星期五.13号在星期五比在其他日子少吗?为了回答这个问题,写一个程序,要求计算每个月的十三号落在周一到周日的次数.给出N年的一个周期,要求计算1900年1月1日至1900+N- ...

  5. 黑色星期五Friday the Thirteenth [USACO 1.2]

    题目描述 13号又是一个星期五.13号在星期五比在其他日子少吗?为了回答这个问题,写一个程序,要求计算每个月的十三号落在周一到周日的次数.给出N年的一个周期,要求计算1900年1月1日至1900+N- ...

  6. usaco 1.1.3

    usaco 1.1.3 - Friday the Thirteenth Is Friday the 13th really an unusual event? That is, does the 13 ...

  7. usaco Shaping Regions

    这就是usaco 前面的windows area的变形. /* ID:jinbo wu TASK:rect1 LANG:C++ */ #include<iostream> #include ...

  8. usaco Postal Vans(dp)

    是哈密顿回路,然后...就不知道怎么写了 ,以前写过类似的不过情况没这么多也没这么复 usaco training 6.1.1 Postal Vans 题解 标签: usaco training题解d ...

  9. usaco Beef McNuggets

    这两天贼烦,ccf炸了,还有一个烦心事.哎我都不知道自己能不能坚持下去了.马上期末考了.这段时间还是抓紧时间复习吧同时刷usaco的节奏要跟以前一样了,毕竟课少了. 题解: 只要你知道以下的数论结论, ...

最新文章

  1. java I/O之装饰者模式
  2. Homebrew安装(MacOS)
  3. Linux内核网络协议栈
  4. 自动以及手动清除手机垃圾文件
  5. Dotnet Core应用跨框架版本运行
  6. Oracle RMAN 学习
  7. MWeb Pro for Mac(Markdown博客生成软件)
  8. canvas练习 - 七巧板绘制
  9. 图片在线编辑器怎么使用教程
  10. nginx参数keepalive_timeout
  11. linux装在机械硬盘怎么样,电脑装了固态硬盘还能再装机械硬盘吗
  12. pythonhistogram教程_Plot Histogram in Python
  13. android虚拟机工作模式,android虚拟机也能用命令行模式
  14. java 括号匹配_Java解决括号匹配算法问题
  15. 知道经纬度来调高德地图的官网API来获取所在的位置(逆地理编码)
  16. 职业发展,选择大都市还是回老家?
  17. 想玩 NAS? 群晖NAS 的选购 配件搭配以及硬盘 RAID指南
  18. 单元测试之 Xunit
  19. 所生成项目的处理器架构“MSIL”与引用“***”的处理器架构“x86”不匹配。这种不匹配可能会导致运行时失败。请考虑通过配置管理器更改您的项目的目标处理器架构,以使您的项目与引用间的处理器架构...
  20. word图文混排复制到CuteEditor图片不显示

热门文章

  1. 玩转VSCode插件之Remote-SSH
  2. IOS单例的两种实现方式
  3. java开发 中台
  4. JSON数据解析及gson.jar包
  5. 2017/10/12 表格与表单
  6. 游戏中反向运动学(ik)的研究与简介
  7. Javascript Array sort排序问题
  8. IE bug:ajax请求返回304解决方案
  9. 解决启动mysql.exe闪退问题
  10. 使用Kettle抽取数据时,出现中文乱码问题解决方案