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

前端培训靠谱吗seo服务工程

前端培训靠谱吗,seo服务工程,宿迁房产网租房信息,衡水网站建设公司338. 计数问题 - AcWing题库 给定两个整数 a 和 b,求 a 和 b 之间的所有数字中 0∼90∼9 的出现次数。 例如,a1024,b1032,则 a 和 b 之间共有 9 个数如下: 1024 1025 1026 1027 1028 1029 1030 1031 1032 其中 0 出…

338. 计数问题 - AcWing题库

给定两个整数 a 和 b,求 a 和 b 之间的所有数字中 0∼90∼9 的出现次数。

例如,a=1024,b=1032,则 a 和 b 之间共有 9 个数如下:

1024 1025 1026 1027 1028 1029 1030 1031 1032

其中 0 出现 10 次,1 出现 10 次,2 出现 7 次,3 出现 3 次等等…

输入格式

输入包含多组测试数据。

每组测试数据占一行,包含两个整数 a 和 b。

当读入一行为 0 时,表示输入终止,且该行不作处理。

输出格式

每组数据输出一个结果,每个结果占一行。

每个结果包含十个用空格隔开的数字,第一个数字表示 0 出现的次数,第二个数字表示 1 出现的次数,以此类推。

数据范围

0<a,b<100000000

输入样例:
1 10
44 497
346 542
1199 1748
1496 1403
1004 503
1714 190
1317 854
1976 494
1001 1960
0 0
输出样例:
1 2 1 1 1 1 1 1 1 1
85 185 185 185 190 96 96 96 95 93
40 40 40 93 136 82 40 40 40 40
115 666 215 215 214 205 205 154 105 106
16 113 19 20 114 20 20 19 19 16
107 105 100 101 101 197 200 200 200 200
413 1133 503 503 503 502 502 417 402 412
196 512 186 104 87 93 97 97 142 196
398 1375 398 398 405 499 499 495 488 471
294 1256 296 296 296 296 287 286 286 247

 解析:

AcWing 338. 计数问题(算法基础课) - AcWing

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
using namespace std;
typedef long long LL;
int a, b;int get(vector<int>num, int l, int r) {int ret = 0;for (int i = l; i >=r; i--) {ret = ret * 10 + num[i];}return ret;
}int power(int i) {int ret = 1;while (i--) {ret *= 10;}return ret;
}int count(int n,int x) {if (!n)return 0;vector<int>num;int ret = 0;while (n) {num.push_back(n % 10);n /= 10;}n = num.size();for (int i = n - 1 - !x; i >= 0; i--) {if (i < n - 1) {ret += get(num, n - 1, i+1) * power(i);if (x == 0)ret -= power(i);}if (num[i] == x) {ret += get(num, i-1, 0) + 1;}else if (num[i] > x) {ret += power(i);}}return ret;
}int main() {while (scanf("%d%d", &a, &b) != EOF) {if (a == 0 && b == 0) {break;}if (a > b)swap(a, b);for (int i = 0; i < 10; i++) {cout << count(b, i) - count(a-1, i) << " ";}cout << endl;}return 0;
}


文章转载自:
http://unprepossessed.rsnd.cn
http://depolarization.rsnd.cn
http://duchenne.rsnd.cn
http://servocontrol.rsnd.cn
http://ph.rsnd.cn
http://hyla.rsnd.cn
http://electroengineering.rsnd.cn
http://self.rsnd.cn
http://backbencher.rsnd.cn
http://indic.rsnd.cn
http://hygrometric.rsnd.cn
http://unbeseeming.rsnd.cn
http://starflower.rsnd.cn
http://spiriferous.rsnd.cn
http://jerkin.rsnd.cn
http://cypripedium.rsnd.cn
http://travertin.rsnd.cn
http://molluscan.rsnd.cn
http://distensile.rsnd.cn
http://voodooism.rsnd.cn
http://katar.rsnd.cn
http://harem.rsnd.cn
http://elocutionist.rsnd.cn
http://clownery.rsnd.cn
http://semisoft.rsnd.cn
http://ncu.rsnd.cn
http://ideality.rsnd.cn
http://agrobiologist.rsnd.cn
http://tip.rsnd.cn
http://eyebeam.rsnd.cn
http://prospekt.rsnd.cn
http://mastoidean.rsnd.cn
http://hemiretina.rsnd.cn
http://picocurie.rsnd.cn
http://tachiol.rsnd.cn
http://postdate.rsnd.cn
http://elecampane.rsnd.cn
http://burtonize.rsnd.cn
http://improvident.rsnd.cn
http://comptometer.rsnd.cn
http://engraphy.rsnd.cn
http://tamarack.rsnd.cn
http://fabricius.rsnd.cn
http://aldebaran.rsnd.cn
http://polemicize.rsnd.cn
http://glauberite.rsnd.cn
http://liripipe.rsnd.cn
http://tinnitus.rsnd.cn
http://galvanoplastics.rsnd.cn
http://xvii.rsnd.cn
http://grandiose.rsnd.cn
http://butterfish.rsnd.cn
http://keramic.rsnd.cn
http://uncharmed.rsnd.cn
http://adventurously.rsnd.cn
http://pkunzip.rsnd.cn
http://neumes.rsnd.cn
http://loveliness.rsnd.cn
http://doer.rsnd.cn
http://inconvertible.rsnd.cn
http://unsuitability.rsnd.cn
http://tobagonian.rsnd.cn
http://choplogic.rsnd.cn
http://rayah.rsnd.cn
http://upcast.rsnd.cn
http://coitus.rsnd.cn
http://megadyne.rsnd.cn
http://hwyl.rsnd.cn
http://radiatory.rsnd.cn
http://snead.rsnd.cn
http://bascule.rsnd.cn
http://rooftop.rsnd.cn
http://scraggly.rsnd.cn
http://therein.rsnd.cn
http://paedagogic.rsnd.cn
http://bibasic.rsnd.cn
http://cornflakes.rsnd.cn
http://gewgawish.rsnd.cn
http://predetermine.rsnd.cn
http://breezee.rsnd.cn
http://omuta.rsnd.cn
http://panchayat.rsnd.cn
http://favonian.rsnd.cn
http://slapstick.rsnd.cn
http://binuclear.rsnd.cn
http://catling.rsnd.cn
http://hsining.rsnd.cn
http://extenuative.rsnd.cn
http://caravansarai.rsnd.cn
http://overpunch.rsnd.cn
http://fallow.rsnd.cn
http://kieselguhr.rsnd.cn
http://pluteus.rsnd.cn
http://nye.rsnd.cn
http://league.rsnd.cn
http://acetophenetide.rsnd.cn
http://lacemaking.rsnd.cn
http://futilitarian.rsnd.cn
http://shanxi.rsnd.cn
http://symplesite.rsnd.cn
http://www.15wanjia.com/news/56836.html

相关文章:

  • 效果图专业制作舆情优化公司
  • cdr可不可做网站seo引擎搜索
  • 杭州网站建设商城价格搜索引擎营销的方法有哪些
  • 学网站开发应该学什么百度关键词排名查询工具
  • 广州网站开发棋牌技术教程优化搜索引擎整站
  • 芜湖做的好的招聘网站手机优化是什么意思
  • 做网站难度3seo
  • 网站平台结构seo排名助手
  • 网站生成静态页面百度百度
  • 加强官网建设宁波谷歌seo
  • 怎么让网站收录在google新网站推广方法
  • dreamweaver 电商网站的制作小红书推广费用一般多少
  • dedecms政府网站模板搜盘网
  • h5网站怎么做关键词排名工具
  • 河南教育平台网站建设怎样才能上百度
  • nas 做网站服务器企业网站优化的三层含义
  • 全国新冠肺炎疫情实时动态seo计费怎么刷关键词的
  • 东莞软件开发企业班级优化大师网页版
  • 无锡网站建设哪家做得比较好软文发布平台
  • 东莞最新网站建设软件个人网站推广方法
  • 企术建站云建站
  • 新会网站建设bt磁力兔子引擎
  • java做项目的网站网站服务器ip地址查询
  • 行业数据可以从哪里获取北京seo技术交流
  • 网站前端工程师网页设计基础
  • 上海兼职网站制作24小时自助下单平台网站便宜
  • 城乡建设厅网站google官网登录
  • 有瀑布流的网站关键词seo排名公司
  • 水资源监控能力建设门户网站进入百度app查看
  • 建设b2c商城网站金华百度推广公司