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

做网站 node phpwordpress外链略缩图

做网站 node php,wordpress外链略缩图,可以免费下源码的网站,外贸企业网站优化题目描述 题目分析 对于输入的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.yayakq.cn/news/59243/

相关文章:

  • 之前做的网站推广怎么删除成都住建局官网网上办事大厅
  • org域名做网站做外贸面料哪个网站可以接单
  • 游戏源码网站免费自己做网站设计制作
  • 淄博网站建设公司推荐智慧政务门户网站建设
  • 恒通建设集团有限公司网站渭南 网站集约化建设
  • 建手机网站怎么收费线上宣传方式
  • 网站说明书的详细说明wordpress文章列表添加字段
  • 莱芜装修网站微信网站是多少
  • 西安网站seo 优帮云做视频网站需要什么软件有哪些
  • 网站访问量来源施工企业资质承包范围
  • 网站更名策划方案免费google账号注册入口
  • 网站建设开发计入什么会计科目长沙哪个平台做网站好
  • 建设银行网站多少关于网站建设的求职意向
  • 设计师网站崩了新闻发布网站建设实训小结
  • 网站维护中 页面网站框架设计图
  • 艾纳网站建设深圳做微信网站
  • frontpage网站模板下载wordpress 上传错误
  • 蒙自做网站的公司有什么网站可以做编程题
  • 新乡河南网站建设展台设计展会展位设计
  • 做网站怎样做才有百度快照苏州网站制作价格
  • 网站seo优化是什么意思系统开发网站
  • html网站设计作品wordpress 判断页面名称
  • 哪个网站的体验做的最好东莞网站建设兼职
  • 厦门网站专业建设二手车网站开发过程
  • 集团网站建设特色在线制作gif
  • 有没有做网站的广州品牌设计
  • 河南生产型企业网站建设自己动手建设网站
  • 房产中介 网站开发上海如何做网站
  • 东莞网站搭建哪里好温州自助建站公司
  • 十大免费ppt课件网站关键词点击工具