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

建网站需要多钱推广方案模板

建网站需要多钱,推广方案模板,广告电商,个人网站免费建设一、Xmind整理&#xff1a; 二、上课笔记整理&#xff1a; 1.第一个c程序&#xff1a;hello world #include <iostream> //#:预处理标识符 //<iostream>:输入输出流类所在的头文件 //istream:输入流类 //ostream:输出流类using namespace std; //std&#x…

一、Xmind整理:

二、上课笔记整理:

1.第一个c++程序:hello world

#include <iostream>
//#:预处理标识符
//<iostream>:输入输出流类所在的头文件
//istream:输入流类
//ostream:输出流类using namespace std;     //std:标准命名空间
//using使用命名空间
//namespace就是命名空间的关键字
//std是标准命名空间名int main()
{cout << "第一个C++程序" << endl;//cout:ostream类的一个类对象,输出,但是不需要格式符// <<:左移运算符的重载,重载为插入运算符(输出运算符)cout << "Hello World!" << endl;return 0;
}

2.cout的使用 

#include <iostream>
#include <iomanip>
using namespace std;int main()
{int a = 16;cout << a << endl;     //16//----------通过关键字控制格式-----------cout << hex << a << endl;     //10 hex十六进制输出cout << a << endl;    //10  ---->因为上一行的cout已经指定了格式,如果想结束掉上述的格式,重新指定格式cout << dec << a << endl;  //dec表示十进制的输出cout << oct << a << endl;  //oct表示八进制输出cout << "-----------------------------" << endl;// ---------通过函数控制格式-------------cout << setbase(16) << a << endl;cout << setbase(8) << a << endl;cout << a << endl;   //20,使用函数仍然改变了cout的输出格式cout << setbase(10) << a << endl;cout << "指定宽度的输出<==>%nd" << endl;cout << setw(4) << left << a ;  //功能和%-4d一样,左对齐使用left,如果不加left默认是右对齐cout << "小数的指定宽度输出 " << endl;cout << setprecision(4) << 3.1456 << endl;//指定的是包含小数点的位置,3.146return 0;
}

3.输出斐波那契的前10项。    1 1 2 3 5 8 13 ····

#include <iostream>using namespace std;
int Fbi(int n)
{if(n==1||n==2){return 1;}else{return Fbi(n-1)+Fbi(n-2);}
}int main()
{int n;cout << "请输入一个数" << endl;cin >> n;for(int i=1;i<=n;i++){Fbi(i);cout << Fbi(i) << endl;}return 0;
}

4. cin标准输入流对象

#include <iostream>
#include <cstdio>
using namespace std;int main()
{int a;//scanf("%d",&a);  //需要控制格式cin >> a;    //cin加上右移运算符重载,再加上变量名,使用cin输入不需要加变量的地址cout << a << endl;char c;cin >> c;    //cin可以实现任意类型的输入cout << "从终端获取的字符c=" << c << endl;return 0;
}

5.终端输入一个字符,判断该字符的类型,字母(大写/小写)、数字字符,其他字符。

#include <iostream>
#include <cstdio>
using namespace std;int main()
{char a;//scanf("%d",&a);  //需要控制格式cin >> a;    //cin加上右移运算符重载,再加上变量名,使用cin输入不需要加变量的地址if(a>='0'&&a<='9'){cout << "a是一个数字" << endl;}else if(a>='A'&&a<='Z'){cout << "a是一个大写字母" << endl;}else if(a>='a'&&a<='z'){cout << "a是一个小写字母" << endl;}return 0;
}

6.局部变量和命名空间冲突

#include <iostream>
//using namespace std;namespace my_namespace {      //定义了一个命名空间int a=2000;int num2;void fun();   //命名空间中写函数的声明
}void my_namespace::fun()   //定义了一个命名空间中的函数
{std::cout << "test" << std::endl;
}using namespace my_namespace;  //引入命名空间中的所有标识符
using my_namespace::num2;   //引入命名空间中的部分标识符int main()
{using std::cout;  //引入std中的cout标识符using std::endl;  //引入std中的endl标识符int a = 90;cout << "局部变量a=" << a << endl;cout << my_namespace::a << endl;fun();return 0;
}

7.全局变量和命名空间冲突问题

#include <iostream>
using namespace std;int a = 3000;
namespace my_namespace {      //定义了一个命名空间int a=2000;int num2;void fun();   //命名空间中写函数的声明
}namespace B {int num2;
}
void my_namespace::fun()   //定义了一个命名空间中的函数
{std::cout << "test" << std::endl;
}using namespace my_namespace;  //引入命名空间中的所有标识符
using namespace B;int main()
{my_namespace::num2=900;    //在使用变量时,使用域限定符cout << B::num2 << endl;cout << my_namespace::a << endl; //通过域限定符和命名空间名访问指定变量acout << ::a << endl;    //访问全局变量areturn 0;
}
【5】命名空间添加
如果定义了多个同名的命名空间,最后多个会合并成一个命名空间
namespace B {int num2;int a = 10;
}namespace B {    //并没有定义新的命名空间B,改行的B会和前面B合并成一个命名空间int b;
}

8.命名空间的嵌套

#include <iostream>
using namespace std;namespace A {    //定义了一个命名空间Aint a=0;namespace B {   //嵌套一个命名空间Bint a=100;char c='a';}
}
using namespace A;
using namespace A::B;  //全局引入A中的命名空间B
int main()
{//cout << A::a << endl;   //0//cout << A::B::a << endl; //100,嵌套的命名空间,访问里面空间标识符时,需要逐级访问cout << c << endl;return 0;
}

9.给命名空间重命名

namespace 新名字 = 旧名字;
namespace NEW = A;   //把命名空间A重命名为NEW新名字和旧名字都可以继续使用
#include <iostream>
using namespace std;namespace A {    //定义了一个命名空间Aint a=0;namespace B {   //嵌套一个命名空间Bint a=100;char c='a';}
}namespace NEW = A;    //给命名空间A重命名为NEW
using namespace NEW;
//using namespace A::B;  //全局引入A中的命名空间B
int main()
{//cout << A::a << endl;   //0//cout << A::B::a << endl; //100,嵌套的命名空间,访问里面空间标识符时,需要逐级访问cout << NEW::B::c << endl;return 0;
}

10.using的其他用法

#include <iostream>
using namespace std;int main()
{typedef int a;a num1 =100;cout << num1 << endl;using INT = int;   //把基本数据类型int重定义为INT,后面可以直接使用INT定义变量INT num2 = 90;cout << sizeof(INT) << endl;return 0;
}

11.C++中字符串的定义

#include <iostream>
#include <cstring>
using namespace std;
int main()
{char str[]="hello";   //C语言风格的字符串,C++中仍然支持,结尾有'\0'cout << sizeof(str) << endl;cout << strlen(str) << endl;  //可以手动导入<cstring>头文件,使用strlen函数//通过string类实现变量的定义string str1 = "hello";   //定义了一个string类型的饿字符串str1并初始化hellostring str2 = str;cout << str2 << endl;   //C语言风格的字符串会自动转换成C++风格的字符串并且可以直接使用str2 = "hi";    //给str2字符串赋值//----------使用单个的字符给字符串赋值-----------string str3(5,'a');  //定义了一个str3字符串,使用5个a初始化cout << str3 << endl;string str4("world");   //定义了一个字符串str4,使用world初始化cout << str4 << endl;//----------多个字符串之间的赋值------------str3 = str4;cout << "s3=" << str3 << endl;cout << "s4=" << str4 << endl;
}

12.C++风格和C风格字符串的转化

#include <iostream>
#include <cstring>
using namespace std;int main()
{char str[]="hello";string str1 = str;   //C风格可以直接转化为C++风格//cout << strlen(str1) << endl;  //C++风格的字符串向C风格转化,需要特定的操作cout << strlen(str1.data()) << endl;  //使用过data函数后,str1可以被strlen计算//cout << strcat(str1.c_str(),"world") << endl;//因为str1.c_str()返回的时hello的字符数组形式,是一个const char*char str3[100]="world";strcat(str3,str1.c_str());cout << str3 << endl;return 0;
}

13.string常用的函数  empty()

#include <iostream>
#include <cstring>
using namespace std;int main()
{char str[]="hello";string str1 = str;   //C风格可以直接转化为C++风格
//  cout << str1.at(7) << endl;cout << str1.length() << endl;cout << str1.size() << endl;str1.clear();cout << str1 << endl;cout << str1.size() << endl;cout << str1.empty() << endl;return 0;
}

14.字符串比较

#include <iostream>
#include <cstring>
using namespace std;int main()
{char str[]="hello";string str1 = str;   //C风格可以直接转化为C++风格string str2 = "hi";if(str1<str2)   //字符串在C++中可以直接参与比较,结果0/1{cout << "str1<str2" << endl;}return 0;
}

15.字符串的输入

#include <iostream>
#include <cstring>
using namespace std;int main()
{char str[]="hello";string str1 = str;   //C风格可以直接转化为C++风格string str2;//cin >> str2;   //不能实现字符串带空格的输入getline(cin,str2);cout << str2 << endl;return 0;
}

16.终端输入一个字符串,以'\n'作为标志停止,判断字母和数字的个数,空格的个数。

#include <iostream>
#include <cstring>
using namespace std;int main()
{string str;getline(cin,str);int len = str.size();  //作为循环条件int num1=0,num2=0,num3=0;for(int i=0;i<len;i++){if(str.at(i)>='a'&&str.at(i)<='z'||str.at(i)>='A'&&str.at(i)<='Z'){num1++;}else if(str.at(i)>='0'&&str.at(i)<='9'){num2++;}else if(str.at(i)==' '){num3++;}}cout << num1 << endl;cout << num2 << endl;cout << num3 << endl;return 0;
}

17.C++中的bool

#include <iostream>
using namespace std;int main()
{bool a=true;cout << a << endl;    //默认是数字表示cout << boolalpha << a << endl;   //加上boolalpha显示字母表示bool b=0;cout << noboolalpha << b << endl;  //加上noboolalpha回到数字表示cout << sizeof(b) << endl;return 0;
}

文章转载自:
http://dinncomannish.tpps.cn
http://dinncocompendia.tpps.cn
http://dinncoinobservancy.tpps.cn
http://dinncohepatopexy.tpps.cn
http://dinncospiritism.tpps.cn
http://dinncoeyas.tpps.cn
http://dinncositten.tpps.cn
http://dinncoprejudication.tpps.cn
http://dinncoacidemia.tpps.cn
http://dinncolimestone.tpps.cn
http://dinncorhythmist.tpps.cn
http://dinncofernanda.tpps.cn
http://dinncoscup.tpps.cn
http://dinncoderatize.tpps.cn
http://dinncocartesianism.tpps.cn
http://dinncoaminophenol.tpps.cn
http://dinncofeatherhead.tpps.cn
http://dinncopneumonic.tpps.cn
http://dinncoasterixis.tpps.cn
http://dinncogrenoble.tpps.cn
http://dinncowigan.tpps.cn
http://dinncohexavalent.tpps.cn
http://dinncohousemother.tpps.cn
http://dinncokate.tpps.cn
http://dinncoflopover.tpps.cn
http://dinncogrittiness.tpps.cn
http://dinncopornographer.tpps.cn
http://dinncoinframedian.tpps.cn
http://dinncokettledrummer.tpps.cn
http://dinncomadagascar.tpps.cn
http://dinncocycloid.tpps.cn
http://dinncokatanga.tpps.cn
http://dinncosyncretise.tpps.cn
http://dinncocockle.tpps.cn
http://dinncoshakiness.tpps.cn
http://dinncosatcoma.tpps.cn
http://dinncosaucepan.tpps.cn
http://dinncomisconception.tpps.cn
http://dinncochalkboard.tpps.cn
http://dinncoperacute.tpps.cn
http://dinncoprairial.tpps.cn
http://dinncozwinglian.tpps.cn
http://dinncostacker.tpps.cn
http://dinncopedicular.tpps.cn
http://dinncodisengage.tpps.cn
http://dinncoschoolchild.tpps.cn
http://dinncogio.tpps.cn
http://dinncotetrapylon.tpps.cn
http://dinncoimpledge.tpps.cn
http://dinncosina.tpps.cn
http://dinncopotherb.tpps.cn
http://dinncossafa.tpps.cn
http://dinncovolatilization.tpps.cn
http://dinncocelebret.tpps.cn
http://dinncoaccrescence.tpps.cn
http://dinncospottiness.tpps.cn
http://dinncoinsulinoma.tpps.cn
http://dinnconeoisolationism.tpps.cn
http://dinncoautoman.tpps.cn
http://dinncosardegna.tpps.cn
http://dinncofirebox.tpps.cn
http://dinncosupraliminal.tpps.cn
http://dinncopatty.tpps.cn
http://dinncoreprocess.tpps.cn
http://dinncolysostaphin.tpps.cn
http://dinncoheilong.tpps.cn
http://dinncosplenectomy.tpps.cn
http://dinncodewindtite.tpps.cn
http://dinncoringworm.tpps.cn
http://dinncohyperlink.tpps.cn
http://dinncowahabi.tpps.cn
http://dinncorestfully.tpps.cn
http://dinncosunless.tpps.cn
http://dinncolangbeinite.tpps.cn
http://dinncolepidoptera.tpps.cn
http://dinncostotious.tpps.cn
http://dinncoaerospace.tpps.cn
http://dinncobrandish.tpps.cn
http://dinncolender.tpps.cn
http://dinncodoornail.tpps.cn
http://dinncolumphead.tpps.cn
http://dinncorepublic.tpps.cn
http://dinncocytotrophoblast.tpps.cn
http://dinncoacajou.tpps.cn
http://dinncogeotropic.tpps.cn
http://dinncosupperless.tpps.cn
http://dinncophotodisintegration.tpps.cn
http://dinncoscutcheon.tpps.cn
http://dinncopiosity.tpps.cn
http://dinncodipetalous.tpps.cn
http://dinncofibbery.tpps.cn
http://dinncocodicillary.tpps.cn
http://dinncoshirker.tpps.cn
http://dinncofootslog.tpps.cn
http://dinncobodyshell.tpps.cn
http://dinncoskyscraping.tpps.cn
http://dinncosphenopsid.tpps.cn
http://dinncoantistrophe.tpps.cn
http://dinncooxotremorine.tpps.cn
http://dinncohussif.tpps.cn
http://www.dinnco.com/news/139983.html

相关文章:

  • 怎么建设信息网站微信做单30元一单
  • 娄底网站建设环球网最新消息疫情
  • 北京seo网站管理seo排名优化推广
  • 开发一套网站系统 多少钱网站推广策略有哪些
  • 网站文章结构变更怎么做301网络营销策略分析报告
  • 快递网站推广怎么做引擎优化seo怎么做
  • javaee是做网站的?网址大全浏览器主页
  • 手机网站建设案例东莞市网站建设
  • 龙岗做网站的公司百度收录提交网站后多久收录
  • 抖音代运营服务内容明细网站推广和网站优化
  • 杭州抖音代运营重庆网站seo好不好
  • 大学生兼职网站开发毕设论文长沙seo网络优化
  • 地板网站建设方案宁波网站推广运营公司
  • ecshop做淘宝客网站网页制作学习
  • 网页设计网站开发需要哪些知识快手刷粉网站推广
  • 做网站有没有免费空间360官方网站网址
  • 网站建设制作设计平台申请网址怎么申请的
  • 下城区做网站百度网盘首页
  • 长沙营销网站建设公司自己的app如何接广告
  • 用其他商标在自己网站做宣传简述如何优化网站的方法
  • 个人建网站教程深圳高端网站建设公司
  • 什么网站是教做纸工的中国联通业绩
  • 电子商务网站建站上海网站建设开发公司
  • 做视频网站需要流媒体吗seo文章是什么
  • 360网站怎么做ppt网络推广外包哪个公司做的比较好
  • 济南网站建设团队网络推广与网络营销的区别
  • 山东网站好f123网站
  • 建设 大型电子商务网站读书网站排名
  • 360网站上做宣传要多少钱厦门关键词优化报价
  • 淘宝客网站怎么推广优化设计六年级上册语文答案