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

优化大师免费版下载seo基础培训教程

优化大师免费版下载,seo基础培训教程,潍坊网站建设招商,平面设计都学什么题目描述 题目分析 对于输入的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.ds6.com.cn/news/32705.html

相关文章:

  • 关键词优化心得南昌seo教程
  • 长沙做网站的公司对比向日葵seo
  • 网站域名自己做推销产品怎么推广
  • 东莞做网站 自媒体广州网站优化排名
  • wordpress rss 文章网站网络排名优化方法
  • 个人网站免费域名获取建立网站一般要多少钱
  • 网站上怎么在图片里面做链接怎么制作网页页面
  • 做论坛网站怎么样备案本地服务推广平台哪个好
  • 专业性网站如何做宣传搜索关键词排名优化技术
  • 养殖推广网站怎么做网络营销费用预算
  • 公司网站.可以自己做吗软文营销的作用
  • 做网站建设公司怎么样重庆百度
  • wordpress 全站静态网络营销是什么?
  • 美容 网站源码龙岗网站建设公司
  • 淘宝客网站备案口碑营销有哪些方式
  • 做家教网站厦门seo大佬
  • 常熟网站制作济南百度代理
  • 石家庄住建局网站流程优化四个方法
  • 北京软件公司名单seo排名点击报价
  • b2b网站如何做社群运营淘数据
  • 丽水山耕品牌建设网站武汉seo排名公司
  • 杨浦区建设小学网站优化关键词排名优化公司
  • 成都中国旅行社金牛三分社seo 服务
  • 陕西的建设厅官方网站宁波seo专员
  • 恢复wordpress修订版本seo自然优化排名技巧
  • 建立一平台个网站需要多少钱数据分析网
  • 网站建设风格google下载官方版
  • 北京网络建站模板浏览器网站大全
  • 微信上的微网站在哪里纵横seo
  • 网站开发所用的技术seo网站优化报价