3451:【例82.1】不吉利日期

3451:【例82.1】不吉利日期

信息学奥赛一本通-编程启蒙(C++版)在线评测系统

[例82.1] 不吉利日期

信息学奥赛一本通-编程启蒙(C++版)在线评测系统

【信息学奥赛一本通-编程启蒙】3451【例82.1】不吉利日期_哔哩哔哩_bilibili

不吉利的日期(PAT)

不吉利的日期(PAT)_在国外,每月的13号和每周的星期5都是不吉利的。特别是当13号那天恰好是星期5时,更-CSDN博客

OpenJudge NOI 1.13 02:不吉利日期

OpenJudge NOI 1.13 02:不吉利日期_1.13.02 不吉利日期-CSDN博客

【信息学奥赛一本通-编程启蒙】3451【例82.1】不吉利日期

【信息学奥赛一本通-编程启蒙】3451【例82.1】不吉利日期_哔哩哔哩_bilibili




/*
1.13编程基础之综合应用_02不吉利日期01
http://noi.openjudge.cn/ch0113/02/
https://blog.csdn.net/ljf_study/article/details/76409549
*/
#include <stdio.h>
#include <iostream>
#include <stack>
#include <string.h>
#include <queue>
#include <cmath>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <string>
using namespace std;
typedef long long LL;
#define MAX 1001
int a[MAX][MAX];
int b[MAX][MAX];
int res[MAX][MAX];
int n, m;
 
int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int sumDay(int month)
{
    int sumday = 0;
    for(int i = 1; i < month; i++){
        sumday += day[i];
    }
    sumday += 13;
    return sumday;
}
 
 
 
int main() {
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    int n;
    cin >> n;
    for(int i = 1; i <= 12; i++){
        if(((sumDay(i) - 1) % 7 + n) % 7 == 5){
            cout << i << endl;
        }
    }
    return 0;
 
}


/*
1.13编程基础之综合应用_02不吉利日期03
http://noi.openjudge.cn/ch0113/02/
https://blog.csdn.net/ljf_study/article/details/76409549
https://blog.csdn.net/tigerisland45/article/details/69791524
https://blog.csdn.net/Gnipuohz/article/details/8300563
*/
#include<stdio.h>
int main()
{
	int day[13]={0,12,31,28,31,30,31,30,31,31,30,31,30};
	int w;
	int i;
	scanf("%d",&w);
	for(i=1;i<=12;i++)
	{w=(w+day[i])%7;
	if(w==5) printf("%d\n",i);
	}
	return 0;
 
}


#include<bits/stdc++.h>
using namespace std;
int w,d;
int main()
{
	cin>>w;
	
	for(int i=1;i<=12;i++)
	{
		if( i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12 )
		{
			d=31;
		}
		else
		{
			if( i==2 )
			{
				d=28;	
			}
			else
			{
				d=30;
			}
		}
		
		for(int j=1;j<=d;j++)
		{
			if( w%7==5 && j==13 )
			{
				cout<<i<<endl;
			}
			
			w++;
		}
	}
	
	return 0;
}



 




Python相关的考试和认证

Python相关的考试和认证_python考级官网-CSDN博客

python刷题 NOI题库 python题解 洛谷、牛客网、AcWing 刷题等

python刷题 NOI题库 python题解 洛谷、牛客网、AcWing 刷题等_acwing和洛谷哪个好-CSDN博客

Python信息技术学考一本通题目讲解、python入门、python习题集整理汇总等

Python信息技术学考一本通题目讲解、python入门、python习题集整理汇总等_信息学奥赛一本通python网站-CSDN博客

python画图系列整理

python画图系列整理_python画图作品-CSDN博客

NOI题库 python题解

https://blog.csdn.net/dllglvzhenfeng/category_11601976.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

dllglvzhenfeng

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值