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

郑州十大网站建设公司网站开发与维护就业前景

郑州十大网站建设公司,网站开发与维护就业前景,腾讯做网站,什邡门户网站这里写目录标题 链接题目代码大佬解答string提取索引转换为值 链接 P8752 [蓝桥杯 2021 省 B2] 特殊年份 题目 代码 #include <iostream> #include <vector> #include <string> #include <algorithm> #include <math.h> #include <queue&g…

这里写目录标题

  • 链接
  • 题目
  • 代码
  • 大佬解答
  • string提取索引转换为值

链接

P8752 [蓝桥杯 2021 省 B2] 特殊年份

题目

在这里插入图片描述

代码

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <queue>
#include <climits>  // 包含INT_MAX常量
#include <cctype>using namespace std;vector<int> years(5);
int num;int check(int n) {int a, b, c, d;d = n % 10;n /= 10;c = n % 10;n /= 10;b = n % 10;n /= 10;a = n;if (a == c && b + 1 == d)return 1;elsereturn 0;
}int main() {for (int i = 0; i < 5; i++) {cin >> years[i];if (check(years[i]))num++;}cout << num;return 0;
}

大佬解答

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <queue>
#include <climits>  // 包含INT_MAX常量
#include <cctype>
using namespace std;int main() {char a, b, c, d;int nums = 0;for (int i = 0; i < 5; i++) {cin >> a >> b >> c >> d;//用于读取四位数的每一位if (a == c && b + 1 == d)nums++;}cout << nums;return 0;
}

string提取索引转换为值

	cin >> s;  cout << s[0] - '0'  << endl;

输入:2025
输出:2

http://www.dtcms.com/wzjs/573201.html

相关文章:

  • 创网站 灵感网站备案程序
  • 茶文化建设网站的意义杭州 高端网站建设 推荐
  • 常用企业网站模板对比用react和ant.d做的网站例子
  • 合肥网站设计建佛山专业网站开发公司
  • 网络工程师 网站建设灵动网站建设
  • 怎么用h5做网站网站规划与建设是什么意思
  • 海口专门做网站广告设计公司有哪些
  • 娱乐网站建设郑州网站推广哪家专业
  • 网站后台管理界面代码做设计哪个网站可以接单
  • 易企营销型网站建设企业wordpress打开失败
  • 西安哪有学做淘宝网站如何做微信电子书下载网站
  • IC 网站建设制作网页软件app
  • 版本设计网站米拓建站模板
  • 衡水建网站北京网站定制建设
  • 网站网站建站红塔网站制作
  • 佛山市网站建设分站多少钱服务型网站建设
  • 万户网站天下ai做图标教程网站
  • 网站如何注销苏州做网站优化的
  • 用cdr做网站设计尺寸要多少wordpress 自动图片大小
  • 山东青岛网站设计公司百度关键词搜索排名多少钱
  • 动态商务网站开发与管理中信建设有限责任公司深圳中信金融中心项目工期专业招标
  • 免费的网站域名查询浏览器群排名优化软件官网
  • 微网站建设教程视频上海建设工程网
  • php做简单网站教程视频教程网站子目录
  • 创建一个网站需要什么海东高端网站建设价格
  • 有什么方法在淘宝发布网站建设设计赣州网站建设设计
  • 创建网站投资多少环保网站建设价格
  • 建手机网站款软件网站建设支付方式
  • dede后台做两个网站办公室设计公司专业网站
  • 高端网站建设企业国内永久免费的crm系统软件