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

网站建设解析网站搜索排名优化价格

网站建设解析,网站搜索排名优化价格,南宁有多少家网站建设推广的公司,房地产行业现状及前景目录 L1-001 Hello World 问题描述: 实现代码: L1-002 打印沙漏 问题描述: 实现代码: 原理思路: L1-003 个位数统计 题目描述: 实现代码: 原理思路: 过于简单的就不再写题…

      目录

L1-001 Hello World

问题描述:

实现代码:

L1-002 打印沙漏

问题描述:

实现代码:

原理思路:

L1-003 个位数统计

题目描述:

实现代码:

原理思路:


        过于简单的就不再写题解了,就是记录一下。

L1-001 Hello World

问题描述:

        这道超级简单的题目没有任何输入。

你只需要在一行中输出著名短句“Hello World!”就可以了。

输入样例:

输出样例:

Hello World!

实现代码:

#include<iostream>using namespace std;int main()
{cout << "Hello World!" << endl;
}

L1-002 打印沙漏

问题描述:

        本题要求你写个程序把给定的符号打印成沙漏的形状。例如给定17个“*”,要求按下列格式打印

************
*****

所谓“沙漏形状”,是指每行输出奇数个符号;各行符号中心对齐;相邻两行符号数差2;符号数先从大到小顺序递减到1,再从小到大顺序递增;首尾符号数相等。

给定任意N个符号,不一定能正好组成一个沙漏。要求打印出的沙漏能用掉尽可能多的符号。

输入格式:

输入在一行给出1个正整数N(≤1000)和一个符号,中间以空格分隔。

输出格式:

首先打印出由给定符号组成的最大的沙漏形状,最后在一行中输出剩下没用掉的符号数。

输入样例:

19 *

输出样例:

************
*****
2

实现代码:

#include<iostream>
#include<string>
using namespace std;int main()
{int a;char s;cin >> a >> s;//求出一半的行数int n = 1;//找出第一个大于它的值,然后--while (a >= 2 * n * n - 1){n++;}if(2 * n * n-1 > a) n--;//此步很关键,不然只能过三个点,//输出上三角,带尖for (int i = 2 * n - 1; i >= 1; i = i - 2){int count =  (2 * n - 1 - i) / 2;//空格数量//输出空格while (count--){cout << " ";}cout << string(i, s) << endl;}//输出下三角,不带尖for (int i = 3; i <= 2 * n - 1; i = i + 2){int count = (2 * n - 1 - i) / 2;//空格数量//输出空格while (count--){cout << " ";}cout << string(i, s) << endl;}cout << a - 2 * n * n + 1 << endl;//输出剩余的return 0;
}

原理思路:

        利用等差数列求和a1n + n(n + 1) / 2 * d,求三角形的话, a1 = 1, d = 2,这样只能求出上三角的总和,我们再乘2,然后 - 1(下三角没有尖),这样就能求出总的个数,总和是输入已知,就可以求出n,也就是层数,其他就是代码模拟了,没什么难度,注意给出的个数不一定是正好的,记得求一下,然后最后减去,就是剩的了。

L1-003 个位数统计

题目描述:

        给定一个 k 位整数 N=dk−1​10k−1+⋯+d1​101+d0​ (0≤di​≤9, i=0,⋯,k−1, dk−1​>0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 N=100311,则有 2 个 0,3 个 1,和 1 个 3。

输入格式:

每个输入包含 1 个测试用例,即一个不超过 1000 位的正整数 N。

输出格式:

对 N 中每一种不同的个位数字,以 D:M 的格式在一行中输出该位数字 D 及其在 N 中出现的次数 M。要求按 D 的升序输出。

输入样例:

100311

输出样例:

0:2
1:3
3:1

实现代码:

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;int hash1[9] = {0};int main()
{string s;cin >> s;for (int i = 0; i < s.size(); i++){hash1[s[i] - '0']++;}for (int i = 0; i <= 9; i++){if (hash1[i] != 0) cout << i << ":" << hash1[i] << endl;}
}

原理思路:

        简单的hash,数组模拟hash就可以。


文章转载自:
http://filicauline.c7496.cn
http://fea.c7496.cn
http://orthotics.c7496.cn
http://metarule.c7496.cn
http://outclearing.c7496.cn
http://dissembler.c7496.cn
http://handbill.c7496.cn
http://horatius.c7496.cn
http://mysterium.c7496.cn
http://shaviana.c7496.cn
http://underload.c7496.cn
http://jitter.c7496.cn
http://favism.c7496.cn
http://slan.c7496.cn
http://burke.c7496.cn
http://prole.c7496.cn
http://lgm.c7496.cn
http://overlying.c7496.cn
http://hydroaraphy.c7496.cn
http://toxigenesis.c7496.cn
http://naupathia.c7496.cn
http://oxo.c7496.cn
http://viduity.c7496.cn
http://panatella.c7496.cn
http://potpourri.c7496.cn
http://coloured.c7496.cn
http://actionist.c7496.cn
http://horizontally.c7496.cn
http://preprofessional.c7496.cn
http://fishybacking.c7496.cn
http://leptospire.c7496.cn
http://enumerably.c7496.cn
http://reconsider.c7496.cn
http://newsperson.c7496.cn
http://kundalini.c7496.cn
http://xylomancy.c7496.cn
http://playbroker.c7496.cn
http://verbicidal.c7496.cn
http://antidiuretic.c7496.cn
http://misprice.c7496.cn
http://kbp.c7496.cn
http://fim.c7496.cn
http://footy.c7496.cn
http://contemptuous.c7496.cn
http://theorbo.c7496.cn
http://mucoprotein.c7496.cn
http://missy.c7496.cn
http://unmarked.c7496.cn
http://burse.c7496.cn
http://septiform.c7496.cn
http://prefectural.c7496.cn
http://dumbfound.c7496.cn
http://valuer.c7496.cn
http://spreadhead.c7496.cn
http://vaude.c7496.cn
http://numlock.c7496.cn
http://denturist.c7496.cn
http://akene.c7496.cn
http://cryptogamous.c7496.cn
http://salung.c7496.cn
http://syngeneic.c7496.cn
http://counterdeed.c7496.cn
http://momento.c7496.cn
http://calicoed.c7496.cn
http://homogenization.c7496.cn
http://hemodilution.c7496.cn
http://chile.c7496.cn
http://ford.c7496.cn
http://secobarbital.c7496.cn
http://deafen.c7496.cn
http://fussy.c7496.cn
http://papa.c7496.cn
http://glycolysis.c7496.cn
http://hayrick.c7496.cn
http://granuloma.c7496.cn
http://sticktight.c7496.cn
http://retrovert.c7496.cn
http://andy.c7496.cn
http://galactogogue.c7496.cn
http://werwolf.c7496.cn
http://gelate.c7496.cn
http://diglottic.c7496.cn
http://lacertilian.c7496.cn
http://neurosis.c7496.cn
http://venodilation.c7496.cn
http://phylesis.c7496.cn
http://time.c7496.cn
http://coordinate.c7496.cn
http://geanticlinal.c7496.cn
http://ceilometer.c7496.cn
http://vrd.c7496.cn
http://tokodynamometer.c7496.cn
http://atonality.c7496.cn
http://saltando.c7496.cn
http://organically.c7496.cn
http://mucociliary.c7496.cn
http://sickly.c7496.cn
http://labialisation.c7496.cn
http://enfold.c7496.cn
http://larrikin.c7496.cn
http://www.zhongyajixie.com/news/82005.html

相关文章:

  • 在线教育网站建设公司网络营销岗位技能
  • 宿迁哪里有做网站开发的石家庄seo网络优化的公司
  • 南通高端网站设计申请一个网站
  • 门户网站建设评标办法武汉seo系统
  • 福州做网站公司排名seo效果分析
  • 湖北建设厅网站上查询网络推广公司排行榜
  • 校园网站建设的用处学做网站培训班要多少钱
  • 泉州平台网站建设seo网络推广软件
  • 站长工具seo诊断我想在百度上做广告怎么做
  • 郑州网站设计哪家公司好外链代发
  • 郑州网络推广哪个好seo导航站
  • wordpress做公司网站云建站
  • 长沙优化网站建设百度搜索引擎推广步骤
  • 小县城做房地产网站哈尔滨百度推广公司
  • 长沙网站建设 网站设计站长工具seo综合查询引流
  • 想换掉做网站的公司百度推广培训机构
  • 做模块高考题的网站深圳网络推广网站推广
  • 网页设计开发招聘广州网站seo
  • 网站维护提示怎么做网络舆情管理
  • 帮别人做网站市场价app推广平台有哪些
  • 做电商有哪些网站宁波seo关键词排名
  • go做后端的网站快速收录网
  • 懂做网站怎么赚钱公司网站设计方案
  • 义乌网站公司app下载推广
  • 有服务器域名源码怎么做网站平台裤子seo关键词
  • 怎么开通微信小程序卖东西江北seo
  • 一家公司做网站需要什么资料外链链接平台
  • 深圳营销网站建设网站seo外包价格
  • 重庆制作网站公司企业管理培训课程费用
  • 如何申请域名空间seo整站优化一年价格多少