这年的开始的第一天是星期 1

代码如下:

========================================================================================================

#include<stdio.h>
#include<algorithm>
#include<vector>
#include<iostream>
#include<math.h>
#include<string.h>
using namespace std; ///平年
int M[]={,,,,,,,,,,,,}; int Week(int date, int month)
{
int w=date; if(month> || month< || date< || date > M[month])
return -; for(int i=; i<month; i++)
w += M[i]; return (w%) ? (w%) : ;
} int main()
{
int date, month; scanf("%d%d", &date, &month); int w = Week(date, month); if(w < )
printf("Impossible\n");
else
printf("%d\n", w); return ;
}

Calendar - SGU 115(日期判断)的更多相关文章

  1. 分享一个根据具体的日期判断星座的PHP函数

    其实原理很简单,也就是把所有的星座月份日期范围存储到一个数组中,然后根据日期判断属于哪个范围,这样就得到是哪个星座了. 下面的这个函数写的比较精炼,可以参考一下 function constellat ...

  2. Calendar 日期判断 等于 。小于。大于

    public static void main(String[] args) throws Exception { String startTime = "2012-12-12 12:45: ...

  3. SGU 115.Calendar

    连水3道,还能更水么... #include <stdio.h> using namespace std; ] = {, , , , , , , , , , , , }; int n, m ...

  4. 【Java】实现一个根据日期判断星座程序的编写

    思路 直接根据月份做索引,然后根据日期边界判断是本月的星座还是上月的. 算法 private static String getAstro(int month, int day) { String[] ...

  5. easyui datebox 扩展清空按钮及日期判断

    <input id="EndHavDate" class="easyui-datebox" data-options="prompt:'请选择结 ...

  6. sql中字符分割,日期判断,以及函数的应用

    前两天公司有一个功能需求,客户给出几天的工作时间和休息,然后顾客的访问时间必须要在工作时间之内和休息时间之外,所以要求做一下判断.本来以为这个没什么,谁知道客户提供的工作时间段和休息时间段不定,给出的 ...

  7. JavaScript中,本周、上周、本月、上月日期判断

    /** * 获取本周.本季度.本月.上月的开端日期.停止日期 */ var now = new Date(); //当前日期 var nowDayOfWeek = now.getDay(); //今天 ...

  8. mydate97时间控件最大值最小值限制及Javascript日期判断大小

    <script language="javascript" type="text/javascript" src="<%=basePath ...

  9. Broken line - SGU 124(判断点与多边形的关系)

    题目大意:RT 分析:构造一条射线,如果穿越偶数条边,那么就在多边形外面,如果穿越奇数条边,那么就在多边形里面. 代码如下: ===================================== ...

随机推荐

  1. xcode7启动页的尺寸设置

    iPhone Portrait iOS 8,9-Retina HD 5.5 (1242×2208) @3x iPhone Portrait iOS 8,9-Retina HD 4.7 (750×133 ...

  2. power shell upload file to azure storage

    # Azure subscription-specific variables. $storageAccountName = "storage-account-name" $con ...

  3. html-----003

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  4. hdoj (1162) 最小生成树

    Problem B Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Sub ...

  5. Bad owner or permissions on .ssh/config

    Bad owner or permissions on $HOME/.ssh/config The ssh with RHEL 4 is a lot more anal about security ...

  6. javascript 学习笔记之面向对象编程(二):继承&多态

    ~~接上篇~~上一篇实现了类的实现以及类成员变量和方法的定义,下面我们来了解下面向对象中两个最重要的特性:继承和多态. 继承 js中同样可以实现类的继承这一面向对象特性,继承父类中的所有成员(变量和属 ...

  7. R 语言DataFrame 排序

    Sort:dd <- data.frame(b = factor(c("Hi","Med","Hi","Low") ...

  8. Python 关于正负无穷float(‘inf’)的一些用法

    Python中可以用如下方式表示正负无穷: float("inf"), float("-inf") 利用 inf 做简单加.乘算术运算仍会得到 inf > ...

  9. Laravel之路——缓存使用

    1.使用Redis类 use Illuminate\Support\Facades\Redis; //设置指定 key 的值(覆盖老的value) Redis::setex('key','value' ...

  10. bzoj 2733: [HNOI2012]永无乡 离线+主席树

    2733: [HNOI2012]永无乡 Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 1167  Solved: 607[Submit][Status ...