当前位置: 首页 > news >正文

网站分站代理加盟金戈枸橼酸西地那非片

网站分站代理加盟,金戈枸橼酸西地那非片,pc网站做app,绿色健康网站模板题目描述 题目分析 对于输入的abc我们可以以a为年也可以以c为年,将abc,cab,cba这三种情况进行判断合法性即可,注意需要排序去重,所以考虑使用set 此处为纯模拟的写法,但使用循环代码会更加简洁。 方法一: #include&…

题目描述

题目分析

对于输入的abc我们可以以a为年也可以以c为年,将abc,cab,cba这三种情况进行判断合法性即可,注意需要排序去重,所以考虑使用set

此处为纯模拟的写法,但使用循环代码会更加简洁。

方法一:

#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
set<string> st;
string s[N];
int cnt;
int m[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool is_ren(int x)
{if((x % 4 == 0 && x % 100 != 0)||(x % 400 == 0))return true;return false;
}
int main()
{int a, b, c;scanf("%d/%d/%d",&a, &b, &c);//以a为年 //abcif(a <= 59){//abcif(b <= 12 && b > 0){int x = 2000 + a;if(is_ren(x))m[2] = 29;else m[2] = 28;if(c <= m[b] && c > 0){cnt ++;s[cnt] = "20";if(a < 10)s[cnt] += "0";s[cnt] += (to_string(a) + "-" );if(b < 10)s[cnt] += "0";s[cnt] += (to_string (b) + "-");if(c < 10)s[cnt] +="0";s[cnt] += to_string(c);st.insert(s[cnt]);}}}else if(a > 59){//abcif(b <= 12 && b > 0){int x = 1900 + a;if(is_ren(x))m[2] = 29;else m[2] = 28;if(c <= m[b] && c > 0){cnt ++;s[cnt] = "19";if(a < 10)s[cnt] += "0";s[cnt] += to_string(a) + "-" ;if(b < 10)s[cnt] += "0";s[cnt] += to_string (b) + "-";if(c < 10)s[cnt] +="0";s[cnt] += to_string(c);st.insert(s[cnt]);}}}//以c为年 //cab, cba if(c <= 59){//cabif(a <= 12 && a > 0){int x = 2000 + c;if(is_ren(x))m[2] = 29;else m[2] = 28;if(b <= m[a] && b > 0){s[++ cnt] = "20";if(c < 10)s[cnt] += "0";s[cnt] += to_string(c) + "-" ;if(a < 10)s[cnt] += "0";s[cnt] += to_string (a) + "-";if(b < 10)s[cnt] +="0";s[cnt] += to_string(b);st.insert(s[cnt]);}}//cbaif(b <= 12 && b > 0){int x = 2000 + c;if(is_ren(x))m[2] = 29;else m[2] = 28;if(a <= m[b] && a > 0){cnt ++;s[cnt] = "20";if(c < 10)s[cnt] += "0";s[cnt] += to_string(c) + "-" ;if(b < 10)s[cnt] += "0";s[cnt] += to_string (b) + "-"; if(a < 10)s[cnt] +="0";s[cnt] += to_string(a);st.insert(s[cnt]);}	}}else if(c > 59){//cabif(a <= 12 && a > 0){int x = 1900 + c;if(is_ren(x))m[2] = 29;else m[2] = 28;if(b <= m[a] && b > 0){cnt ++;s[cnt] = "19";if(c < 10)s[cnt] += "0";s[cnt] += to_string(c) + "-" ;if(a < 10)s[cnt] += "0";s[cnt] += to_string (a) + "-";if(b < 10)s[cnt] +="0";s[cnt] += to_string(b);st.insert(s[cnt]);}}//cbaif(b <= 12 && b > 0){int x = 1900 + c;if(is_ren(x))m[2] = 29;else m[2] = 28;if(a <= m[b] && a > 0){cnt ++;s[cnt] = "20";if(c < 10)s[cnt] += "0";s[cnt] += to_string(c) + "-" ;if(b < 10)s[cnt] += "0";s[cnt] += to_string (b) + "-";if(a < 10)s[cnt] +="0";s[cnt] += to_string(a);st.insert(s[cnt]);}}}for(auto i : st){cout << i << '\n';}return 0;
}

方法二:

#include<bits/stdc++.h>
using namespace std;
int days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
bool check_valid(int year, int month, int day)
{if(month == 0 || month > 12)return false;if(day == 0)return false;if(month != 2){if(day > days[month])return false;}else{int leap = year % 100 && year % 4 == 0 || year % 400 == 0;if(day > 28 + leap)return false;}return true;
}
int main()
{int a, b, c;scanf("%d/%d/%d", &a, &b, &c);for(int date = 19600101; date <= 20591231; date ++){int year = date / 10000, month = date % 10000 / 100, day = date % 100;if(check_valid(year, month, day)){if(year % 100 == a && month == b && day == c ||month == a && day == b && year % 100 == c ||day == a && month == b && year % 100 == c)printf("%d-%02d-%02d\n", year, month, day);}}return 0;
}
http://www.shuangfujiaoyu.com/news/17750.html

相关文章:

  • com是什么网站深圳最新政策消息
  • 网站开发基本工资是多少推广联盟
  • 济南网站维护公司关键词推广优化外包
  • 红色色系网站市场调研报告最佳范文
  • 杭州网站制作推荐网站广告投放价格表
  • 山东淄博网站建设seo优化平台
  • wordpress 汽车 模板惠州seo推广优化
  • 网站代码优化方法网址信息查询
  • 宁波企业网站优化推广中国网新山东
  • jsp网站开发登陆个人网页免费域名注册入口
  • 英文公司网站建设湖南seo快速排名
  • mysql asp网站开发成都百度推广
  • 聊城专业网站开发公司网站赚钱
  • 心雨在线高端网站建设网页设计珠海企业网站建设
  • wordpress theme demo bar杭州网站运营十年乐云seo
  • 资源网站推荐成都有实力的seo团队
  • 自己买空间做网站百度搜索引擎优化案例
  • 连云港专业做网站seo的方法有哪些
  • 怎么做虚拟币网站小红书关键词排名优化
  • 八里庄网站建设公司灰色词seo排名
  • 怎样做网站排名广州百度seo 网站推广
  • 外包网站开发南宁网络推广培训机构
  • 菊子曰 wordpress河南seo关键词排名优化
  • 一个网站做3个关键词够郑州seo排名优化
  • 好文本网站内容管理系统现在推广引流什么平台比较火
  • 合肥做淘宝网站推广站长统计 网站统计
  • 买一个网站需要多少钱百度关键词流量查询
  • 汕头网站建设世界比分榜
  • 做网站还需要买服务器么专注于网站营销服务
  • 做一个网站怎么做数据库在线识别图片来源