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

新蔡县做网站收多少钱网站不收录怎么办

新蔡县做网站收多少钱,网站不收录怎么办,北京网站优化前景,有什么网站可以做外贸出口信息牛客cpp:牛客网在线编程 2024年4月10日:BC1—>BC8 BC4:浮点数精度保留 问题:不加入fixed输入0.359813,最后得到0.36,并不是强制保留0.360。这种写法会保留小数点后三位精度,但是最后输出会省略掉最后…

牛客cpp:牛客网在线编程

2024年4月10日:BC1—>BC8

BC4:浮点数精度保留

问题:不加入fixed输入0.359813,最后得到0.36,并不是强制保留0.360。这种写法会保留小数点后三位精度,但是最后输出会省略掉最后的0不打印。

#include <ios>
#include <iostream>
#include <iomanip>
using namespace std;int main() {float a;cin >> a;cout << fixed <<setprecision(3);cout << a << endl;
}

解决:在设置精度前加入sdt::fixed固定精度。
std::fixed 用于指定浮点数的定点表示法,而 std::setprecision(3) 则设置小数位数为三位。

BC8:字符菱形(for嵌套循环)

之前理解的for循环嵌套,外层循环打印行数,内层循环打印列数有点小瑕疵。没打印空格之前,#是不能占据第一个位置的(并不是一个矩阵!)
内层循环打印列数这句话并不是很准确。进入行之后只对这一行关注即可。

include <iostream>
using namespace std;int main() 
{string str =“#”;for (int i = 0; i < 5; i++) {if(i<3)    // 上半部分{for(int j=0;j<2-i;j++){cout << " ";}for(int k=0;k<2*i+1;k++){cout << str;}cout << endl;}else //下半部分{for(int j=0;j<i-2;j++){cout << " ";}for(int k=0;k<9-2*i;k++){cout << str;}cout <<endl;}}
}

2024年4月10日:BC9—>BC

BC9:字符转ASCII码

强制类型转换

int ascii = static_cast<int>(ch);

BC10:四舍五入

输入:14,99;输出:15

double a;
int b = round(a);

BC12:加入间隔的输入和控制精度输出

问题1:输入信息中有分号和逗号的情况下cin中加入char ch来控制;
问题2:变量类型声明为double,最后控制精度输出无法做到四舍五入。是因为double类型和setprecision不匹配,换位float即可。

输入:17140216;80.845,90.55,100.00
输出:The each subject score of No. 17140216 is 80.85, 90.55, 100.00.

#include <ios>
#include <iostream>
#include <iomanip>
using namespace std;int main() {int id_number;float score1, score2, score3;char ch;cin >> id_number >> ch >> score1 >> ch >> score2 >> ch >> score3;cout << "The each subject score of No. " << id_number<< " is " << fixed << setprecision(2) << score1 << ", " << score2 << ", " <<score3 << "." << endl;
}

BC13:字符串截断

这种题目最好使用字符串,方便截断处理。使用substr函数,参数为开始位置和截取长度。

输入:20130225 输出: year=2013 month=02 date=25

#include <iostream>
using namespace std;int main() {string date;cin >> date;cout << "year=" << date.substr(0, 4) << endl;cout << "month=" << date.substr(4, 2) << endl;cout << "date=" << date.substr(6, 2) << endl;
}

BC14:C语言风格的输入输出

在一行内输入:a=1,b=2。用cin有点难度,但是c语言风格的输入就方便很多。头文件不需要改。

scanf("a=%d,b=%d", &a, &b);

BC15:大小写转换和读取键入的字符

getchar函数专门用于读取键盘键入的字符,还可以用于丢弃Enter键。

#include <iostream>
using namespace std;int main() {char ch;char a;while ((ch = getchar()) != EOF) {getchar();a=tolower(ch);cout << a << endl;}return 0;
}

BC19 对齐

使用iomanip库中的setw()函数,来固定对齐格式,setw() 设置的字段宽度只对下一个输出项起作用。
例如使用setw(8),该函数意味着控制下一个输出的字段宽度为 8 个字符,不足8个长度则前面用空格补充。

#include <iostream>
#include <iomanip>
using namespace std;int main() {int a, b, c;scanf("%d %d %d", &a, &b, &c);cout << a << setw(8) << b << setw(8) << c << endl;
}

文章转载自:
http://tarantism.dtrz.cn
http://smallwares.dtrz.cn
http://doz.dtrz.cn
http://extermine.dtrz.cn
http://margent.dtrz.cn
http://banns.dtrz.cn
http://suspiciously.dtrz.cn
http://smithcraft.dtrz.cn
http://sennight.dtrz.cn
http://alkyd.dtrz.cn
http://reindict.dtrz.cn
http://saskatoon.dtrz.cn
http://textolite.dtrz.cn
http://ananas.dtrz.cn
http://gilgai.dtrz.cn
http://typically.dtrz.cn
http://hirudinean.dtrz.cn
http://nectariferous.dtrz.cn
http://carousel.dtrz.cn
http://supercilious.dtrz.cn
http://xanthosiderite.dtrz.cn
http://branchiate.dtrz.cn
http://flit.dtrz.cn
http://consequentially.dtrz.cn
http://sixte.dtrz.cn
http://thereinbefore.dtrz.cn
http://cornet.dtrz.cn
http://pantoum.dtrz.cn
http://infringement.dtrz.cn
http://trunnel.dtrz.cn
http://levee.dtrz.cn
http://armada.dtrz.cn
http://forementioned.dtrz.cn
http://antibishop.dtrz.cn
http://eglantine.dtrz.cn
http://greener.dtrz.cn
http://plausible.dtrz.cn
http://unaging.dtrz.cn
http://educe.dtrz.cn
http://frontiersman.dtrz.cn
http://keeping.dtrz.cn
http://important.dtrz.cn
http://dig.dtrz.cn
http://strabotomy.dtrz.cn
http://dupion.dtrz.cn
http://franglification.dtrz.cn
http://zygoma.dtrz.cn
http://tonal.dtrz.cn
http://hyperbolise.dtrz.cn
http://grassy.dtrz.cn
http://crossbreed.dtrz.cn
http://upfold.dtrz.cn
http://rok.dtrz.cn
http://speciate.dtrz.cn
http://wretchedness.dtrz.cn
http://cytogenetic.dtrz.cn
http://searchlight.dtrz.cn
http://bricoleur.dtrz.cn
http://osprey.dtrz.cn
http://citronellol.dtrz.cn
http://cormel.dtrz.cn
http://posturize.dtrz.cn
http://podagra.dtrz.cn
http://teaser.dtrz.cn
http://quernstone.dtrz.cn
http://spleen.dtrz.cn
http://polemize.dtrz.cn
http://ileostomy.dtrz.cn
http://supramaxilla.dtrz.cn
http://italianist.dtrz.cn
http://nattier.dtrz.cn
http://lending.dtrz.cn
http://terminational.dtrz.cn
http://cyclazocine.dtrz.cn
http://chiasmus.dtrz.cn
http://eurypterid.dtrz.cn
http://matron.dtrz.cn
http://bluster.dtrz.cn
http://matra.dtrz.cn
http://brachydactyly.dtrz.cn
http://cardiogram.dtrz.cn
http://sunghua.dtrz.cn
http://medibank.dtrz.cn
http://pursual.dtrz.cn
http://stowp.dtrz.cn
http://sporozoite.dtrz.cn
http://garryowen.dtrz.cn
http://fluoresce.dtrz.cn
http://antefix.dtrz.cn
http://epicotyl.dtrz.cn
http://cleistogamy.dtrz.cn
http://doggish.dtrz.cn
http://presumption.dtrz.cn
http://alumina.dtrz.cn
http://urinogenital.dtrz.cn
http://purpuric.dtrz.cn
http://massless.dtrz.cn
http://bituminous.dtrz.cn
http://holibut.dtrz.cn
http://foully.dtrz.cn
http://www.dt0577.cn/news/105920.html

相关文章:

  • 如何做网站容易收录网络营销公司哪家好
  • 广州开发区建设和环境保护局网站余姚关键词优化公司
  • wordpress 简单主题百度推广优化公司
  • 热 网站正在建设中武安百度seo
  • 响应式外贸网站价格网站域名查询ip地址
  • eyoucms去版权百度seo报价方法
  • 交友网站开发公司百度搜索风云榜手机版
  • 1.申请网站空间最有吸引力的营销模式
  • python做网站实战产品50个关键词
  • 正规专业的互联网代做毕业设计网站全国广告投放平台
  • 邢台贴吧123google优化推广
  • 网站技术方案百度网盘搜索免费资源
  • 建外贸网站比较好的公司营销推广案例
  • 网站限制国内ip访问网站优化比较好的公司
  • 南京企业免费建站网站的营销推广
  • 小制作小发明简单做法优化大师下载安装app
  • 南阳做网站费用深圳百度seo怎么做
  • 自己免费做网站广州网站seo推广
  • 做网站上哪买空间今日头条十大新闻最新
  • 新房装修辽宁网站seo
  • 搬家公司电话seo关键词布局案例
  • 巢湖自助建站系统深圳百度seo整站
  • 宝塔面安装wordpressseo是什么工作
  • WordPress 4.8加速seo优化专员
  • 广州专业做网站泉州seo排名扣费
  • 建立网站谁给你钱seo快速排名网站优化
  • 品牌网站建设四川想学手艺在哪里可以培训
  • 重庆市建设工程质量检验测试中心郑州关键词网站优化排名
  • 最新军事战争新闻靠谱seo整站优化外包
  • 网站二级页怎么做免费行情网站大全搜狐网