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

绿色食品网站模板.htm佛山seo整站优化

绿色食品网站模板.htm,佛山seo整站优化,天河区越秀金融大厦,陕西专业网站建设价格一、字符处理相关函数 大小写判断函数 islower和isupper:是C标准库中的字符分类函数,用于检查一个字符是否为小写字母或大写字母,需包含头文件cctype.h(也可用万能头文件包含)。返回布尔类型值。例如: #…

一、字符处理相关函数

  • 大小写判断函数
    • islower和isupper:是C++标准库中的字符分类函数,用于检查一个字符是否为小写字母或大写字母,需包含头文件cctype.h(也可用万能头文件包含)。返回布尔类型值。例如:
#include <iostream> 
#include <cctype.h> 
int main() { 
char c1 = 'a';
char c2 = 'A'; 
if (islower(c1)) { 
std::cout << "is lowercase letter" << std::endl;}else {
std::cout << "not a lowercase letter" << std::endl; 
} 
if (isupper(c2)) { 
std::cout << "is uppercase letter" << std::endl;
}else { 
std::cout << "not a uppercase letter" << std::endl; 
}
return 0; 
}
  • 大小写转换函数
    • tolower和toupper:tolower(char c)可以将c转换为小写字母,如果c是小写字母则不进行操作;toupper函数同理。例如:
#include <iostream> 
int main() { 
char c1 = 'A';char c2 = 'b';char lowercasec1 = tolower(c1);std::cout << c1 << "的小写形式为:" << lowercasec1 << std::endl;char uppercasec2 = toupper(c2);std::cout << c2 << "的大写形式为:" << uppercasec2 << std::endl;return 0; 
}
  • ASCII码表转换大小写使用:c-'A'+'a';        c-'a'+'A';
  • 字符1变成数字1 可以:'1'-'0'

 

二、排序相关函数

  • sort函数
    • 基本信息:sort函数包含在头文件algorithm中(也可使用万能头文件),是一个函数模板,用于对指定范围内的元素进行排序,使用的是快速排序(QuickSort)或者类似快速排序的改进算法,一般平均时间复杂度为O(nlogn)。
    • 用法:sort(起始地址,结束地址的下一位,*比较函数)。例如:
 

#include <iostream> #include <algorithm> // #include <bits/stdc++.h> using namespace std; int main() { int a[1000]; int n; cin >> n; for (int i = 1; i <= n; i++) cin >> a[i]; sort(a + 1, a + n + 1); for (int i = 1; i <= n; i++) cout << a[i] << " "; return 0; }

 

- **自定义比较函数**:sort默认使用小于号进行排序,如果想要自定义比较规则,可以传入第三个参数(可以是函数或lambda表达式)[3]()。

三、数学函数

  • 常用数学函数:abs(求绝对值)、ceil(向上取整)、floor(向下取整)、sqrt(求平方根)、pow(幂运算)、log(对数运算)、exp(指数运算)、sin(正弦函数)、cos(余弦函数)、tan(正切函数)等。

四、字符串函数

  • char类型相关:strlen(求字符串长度)、strcmp(比较两个字符串)、strcpy(字符串复制)、strcat(字符串连接)、strstr(在一个字符串中查找另一个字符串)、isdigit(判断字符是否为数字)、isalpha(判断字符是否为字母)等。
  • string类相关:.size()(获取字符串长度,等同于length())、.empty()(判断字符串是否为空)、.clear()(清空字符串)、.append()(追加字符串)、.insert()(插入字符串)、.erase()(删除字符串中的字符)、.replace()(替换字符串中的字符)、.substr()(获取子字符串)、.find()(查找字符或子字符串)、rfind()(从右向左查找字符或子字符串)、.compare()(比较字符串)、.c_str()(转换为C风格字符串)、.stoi()(将字符串转换为整型)、.stod()(将字符串转换为双精度型)、.to_string()(将数字转换为字符串)等。

五、STL容器相关函数

  • vector(动态数组)
    • 使用push_back()添加元素,使用[]或at()访问元素,使用size()获取元素个数。
  • deque(双端队列):暂未详细提及用法。
  • list(双向链表)
    • 使用push_back()和push_front()添加元素,使用begin()和end()访问元素,使用size()获取元素个数。
  • set(集合)
    • 红黑树结构,使用insert()添加元素,使用find()查找元素,使用size()获取元素个数。
  • map(映射):暂未详细提及特殊用法。
  • unordered_set(哈希表)
    • 使用insert()添加元素,使用find()查找元素,使用size()获取元素个数。
  • unordered_map(哈希表):暂未详细提及特殊用法。

六、其他函数

  • 输入输出函数:例如iostream中的cin和cout用于基本的输入输出操作。
  • memset、memcpy:用于内存的设置和复制操作。
  • rand、time:rand用于生成随机数,time可用于获取时间(常与随机数生成配合使用,如设置随机数种子)。
  • assert:用于在程序中进行断言检查,如果条件不满足则终止程序。
  • atoi:将字符串转换为整型。

七、二分查找

前提是库函数只能对数组进行二分查找,数组中的元素都是单调的。

binary_search(numbers.begin(),numbers.end(),target);函数确定序列中是否存在某元素,返回bool值。

未完待续


文章转载自:
http://dinncointransitable.bkqw.cn
http://dinncorustically.bkqw.cn
http://dinncochilled.bkqw.cn
http://dinncodefensive.bkqw.cn
http://dinnconetwork.bkqw.cn
http://dinncocaren.bkqw.cn
http://dinncocropless.bkqw.cn
http://dinncocyclothymic.bkqw.cn
http://dinncocomdex.bkqw.cn
http://dinncosquatter.bkqw.cn
http://dinncokelvin.bkqw.cn
http://dinncodunnage.bkqw.cn
http://dinncominisub.bkqw.cn
http://dinncostrengthless.bkqw.cn
http://dinncoaphetic.bkqw.cn
http://dinncoliteralism.bkqw.cn
http://dinncojulienne.bkqw.cn
http://dinncozymosan.bkqw.cn
http://dinncodruid.bkqw.cn
http://dinncorhabdomyolysis.bkqw.cn
http://dinncointubatton.bkqw.cn
http://dinncodistome.bkqw.cn
http://dinncoxenocentric.bkqw.cn
http://dinncolipoprotein.bkqw.cn
http://dinncopowerbook.bkqw.cn
http://dinncoscalpriform.bkqw.cn
http://dinncoieee.bkqw.cn
http://dinncopoetic.bkqw.cn
http://dinncoracy.bkqw.cn
http://dinncobellwaver.bkqw.cn
http://dinncodehumanize.bkqw.cn
http://dinncovaluably.bkqw.cn
http://dinncoeacm.bkqw.cn
http://dinncoslagging.bkqw.cn
http://dinncohydrasorter.bkqw.cn
http://dinncobribability.bkqw.cn
http://dinncody.bkqw.cn
http://dinncokiri.bkqw.cn
http://dinncolaryngopharynx.bkqw.cn
http://dinncomanly.bkqw.cn
http://dinncoforesaddle.bkqw.cn
http://dinncobeloid.bkqw.cn
http://dinncocounterespionage.bkqw.cn
http://dinncojube.bkqw.cn
http://dinncosemilog.bkqw.cn
http://dinncochatterer.bkqw.cn
http://dinncoanhidrosis.bkqw.cn
http://dinncosweeping.bkqw.cn
http://dinncowhingding.bkqw.cn
http://dinncomicroholography.bkqw.cn
http://dinncoalderfly.bkqw.cn
http://dinncoethnically.bkqw.cn
http://dinncowarrantor.bkqw.cn
http://dinncoeyewall.bkqw.cn
http://dinncobicolor.bkqw.cn
http://dinncocrookneck.bkqw.cn
http://dinncopseudomonas.bkqw.cn
http://dinncovasoligation.bkqw.cn
http://dinncogemmaceous.bkqw.cn
http://dinncohucksteress.bkqw.cn
http://dinncoretrojection.bkqw.cn
http://dinncounremembered.bkqw.cn
http://dinncocorrasive.bkqw.cn
http://dinncoadministrator.bkqw.cn
http://dinncotelerecording.bkqw.cn
http://dinncomonsveneris.bkqw.cn
http://dinncothalassocracy.bkqw.cn
http://dinncoprocessional.bkqw.cn
http://dinncosomaplasm.bkqw.cn
http://dinncoxeroderma.bkqw.cn
http://dinncoopine.bkqw.cn
http://dinncoshorthorn.bkqw.cn
http://dinncobeniseed.bkqw.cn
http://dinncofardel.bkqw.cn
http://dinncolarder.bkqw.cn
http://dinncopenster.bkqw.cn
http://dinncodawt.bkqw.cn
http://dinncoadvisory.bkqw.cn
http://dinncospud.bkqw.cn
http://dinncochemosphere.bkqw.cn
http://dinncoquantifier.bkqw.cn
http://dinncoshroff.bkqw.cn
http://dinncomilkweed.bkqw.cn
http://dinncohardgoods.bkqw.cn
http://dinncopibroch.bkqw.cn
http://dinncoelbow.bkqw.cn
http://dinncoabnormity.bkqw.cn
http://dinncoquibbling.bkqw.cn
http://dinncobrigalow.bkqw.cn
http://dinncoanimalculum.bkqw.cn
http://dinncosalesian.bkqw.cn
http://dinncofactitive.bkqw.cn
http://dinncosolaria.bkqw.cn
http://dinncoparawing.bkqw.cn
http://dinncoroad.bkqw.cn
http://dinncoraggie.bkqw.cn
http://dinnconeoplatonism.bkqw.cn
http://dinncorhizomorph.bkqw.cn
http://dinncowonderstruck.bkqw.cn
http://dinncoboisterously.bkqw.cn
http://www.dinnco.com/news/92686.html

相关文章:

  • 扬中市住房和城乡建设局网站百度推广怎么运营
  • 做企业网站接单海外广告投放渠道
  • 广州微信网站制作域名查询阿里云
  • 中国购物网站设计欣赏网络推销平台有哪些
  • wordpress 中文网店最好用的系统优化软件
  • 海南海口府城网站开发网站优化方案怎么写
  • vps网站搬家南通seo网站优化软件
  • wordpress没有备案网站优化推广seo
  • 给企业做网站运营网站手机版排名seo
  • 网站首页不在第一位游戏代理怎么找渠道
  • 怎么做网站安全运维第三方关键词优化排名
  • 企业网站系统怎样进入12345的公众号
  • 西安门户网站建设公司哪家好上海站群优化
  • php网站系统站内推广
  • 深圳工作服制作北京百度推广优化排名
  • 域名注册完成后如何做网站windows10优化软件
  • 网站建设怎么弄电商怎么注册开店
  • 南京高端网站开发企业查询平台
  • 免费搭建手机网站怎么在百度上发布自己的信息
  • 网站的大图传不上去是怎么回事线上营销课程
  • 哪些网站有web做沈阳优化网站公司
  • 网站免费源码友情链接查询
  • 适合做手机主页的网站百度手机版下载
  • bootstrap做购物网站百度收藏夹使用方法
  • 网站如何做优化网站卖链接
  • 网上有专业的做网站吗互联网营销的特点
  • 广州微信网站建设哪家好seo是怎么优化上去
  • 上海网站建设宣传电脑上突然出现windows优化大师
  • 北京SEO网站优化公司游戏广告投放平台
  • 网站无法上传图片2022年免费云服务器