中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

可以做外鏈的圖片網(wǎng)站成都網(wǎng)絡(luò)營銷推廣公司

可以做外鏈的圖片網(wǎng)站,成都網(wǎng)絡(luò)營銷推廣公司,產(chǎn)品研發(fā),青木三色品牌商城網(wǎng)站開發(fā)是我深夜爆炸&#xff0c;不能再去補(bǔ)救C了&#xff0c;真的來不及了&#xff0c;不能再三天打魚兩天曬網(wǎng)了&#xff0c;真的來不及了嗚嗚嗚嗚 我實(shí)在是不知道看什么課&#xff0c;那黑馬吧……MOOC的北郵的C正在進(jìn)行嗚嗚 #include <iostream> using namespace std; int…

是我深夜爆炸,不能再去補(bǔ)救C了,真的來不及了,不能再三天打魚兩天曬網(wǎng)了,真的來不及了嗚嗚嗚嗚

我實(shí)在是不知道看什么課,那黑馬吧……MOOC的北郵的C++正在進(jìn)行嗚嗚

#include <iostream>
using namespace std;
int main() 
{cout << "hallo world" << endl;system("pause");return 0;
}
1.1? 變量

定義變量:數(shù)據(jù)類型? 變量名稱 = 變量初始值【格式】

1.2? 常量? 不可修改

1,#define 宏常量,#define 常量名? 常量值
2,const? 修飾的變量? ,const? 數(shù)據(jù)類型 常量名=常量值

#include <iostream>
#define DAY 7
using namespace std;
int main() 
{const int mouth = 31;cout << "hallo world,一周"<<DAY<<"天,大月"<<mouth << endl;system("pause");return 0;
}
1.3??關(guān)鍵字

標(biāo)識(shí)符命名規(guī)則:非關(guān)鍵字,字母+數(shù)字+下劃線,首位非數(shù)字,大小寫
建議,最好能夠見名知意

二,數(shù)據(jù)類型

2.1? 整型

short ==2 【-32768~32767】;int ==4;long==4(分那啥);long long==8;
sizeof( )

#include <iostream>
using namespace std;
int main() 
{short num1 = 32768;int num2 = 32768;long num3 = 0;long long num4 = 0;cout << num1 << "——"<<sizeof(short)<<endl;cout << num2 << "——" << sizeof(int) << endl;cout << num3 << "——" << sizeof(long) << endl;cout << num4 << "——" << sizeof(long long) << endl;system("pause");return 0;
}
2.2? 實(shí)型(浮點(diǎn)型

float 單精度,7有效數(shù)字,數(shù)值后面加上F表示類型;double,雙。。,15-16位
默認(rèn)輸出6位小數(shù),科學(xué)計(jì)數(shù)法

#include <iostream>
using namespace std;
int main() 
{float fnum1 = 3.15344534f;//加后綴自動(dòng)識(shí)別FLOAT,否則DOUBLEdouble dnum2 = 4.4335363748456345234232;float num3 = 3e2;float num4 = 3e-2;cout << fnum1 << "——"<<sizeof(float)<<endl;cout << dnum2 << "——" << sizeof(double) << endl;cout << num3 << endl;cout << num4 << endl;system("pause");return 0;
}
?2.3? 字符型

CHAR? 變量名 =‘單個(gè)字符’,大小1字節(jié),ASCII碼,a-97,A-67,0-31控制字符,32-126打印字符

#include <iostream>
using namespace std;
int main() 
{char a = 'a';cout << a << "——"<<sizeof(char)<<endl;cout << a << "——" << (int)a << endl;system("pause");return 0;
}
2.4 轉(zhuǎn)義字符

水平制表符——對(duì)齊、整齊輸出,換頁和垂直制表感覺和換行差不多

#include <iostream>
using namespace std;
int main()
{cout << "aaa\abbb" << endl;cout << "aaa\bbb" << endl;cout << "aaa\f換頁bbb" << endl;cout << "aaa\nbbb" << endl;cout << "aaa\tbbb" << endl;cout << "a\tbbb" << endl;cout << "aaa\vbbb\v垂直制表" << endl;cout << "aaa\vbbb\v垂直制表" << endl;cout << "aaa\\bbb" << endl;cout << "aaa\'bbb" << endl;cout << "aaa\"bbb" << endl;cout << "aaa\?bbb" << endl;return 0;system("pause");
}
2.5 字符串型

1,C風(fēng)格字符串:CHAR 變量名【】=“字符串值”;CHAR A='A'字符,CHAR A[ ]="A"字符串
2,C++風(fēng)格字符串:STRING 變量名=“字符串值”;;包含頭文件#include <string>

#include <iostream>
#include <string>
using namespace std;
int main()
{char a[] = "hallo word?";string b = "ni hao,xiexie";cout << a << endl;cout << b << endl;return 0;system("pause");
}
2.6 布爾類型BOOL

true--1,false--0,sizeof(bool)==1;賦值給數(shù)字,除了0都代表真

#include <iostream>
using namespace std;
int main()
{bool flag = true;cout << flag << endl;flag = false;cout << flag << endl;cout << sizeof(bool) << endl;//1return 0;system("pause");
}
2.7 數(shù)據(jù)輸入
#include <iostream>
#include<string>
using namespace std;
int main()
{//intint ant = 23;cout << ant << endl;cin >> ant;cout << ant << endl;//floatfloat ff = 5.8900f;cout << ff << endl;//輸出抹零了cin >> ff;cout << ff << endl;//charchar ch = 'a';cout << ch << endl;cin >> ch;cout << ch << endl;//stringstring b= "qunidsefw";cout << b << endl;cin >> b;cout << b << endl;//boolbool flag = false;cout << flag << endl;//除了0,輸入啥都是1cin >> flag;cout << flag << endl;return 0;system("pause");
}

三,運(yùn)算符

3.1 算數(shù)運(yùn)算符

+,-,*,/,%【小數(shù)和小數(shù)不能做取余運(yùn)算】,++A,A++,--A,A--,同C

#include <iostream>
using namespace std;
int main()
{int a = 2;int b = a++;int c = ++a;cout << a << "\t" << b << "\t" << c << endl;cout << c % a << endl;cout << a++ * 100 << endl;cout << ++a * 100 << endl;return 0;system("pause");
}
3.2 賦值運(yùn)算符

+=,-=,*=,/=,=,%=

3.3 比較運(yùn)算符

==,!=,<,>,<=,>=

#include <iostream>
using namespace std;
int main()
{int a = 2;int b = ++a;cout << (a>b)<< endl;cout << (a < b) << endl;cout << (a != b) << endl;cout << (a==b)<< endl;cout << (a <= b) << endl;cout << (a >= b) << endl;return 0;system("pause");
}
3.4 邏輯運(yùn)算符

!非【BOOL里面,不是0都是真】,&&與,||或

#include <iostream>
using namespace std;
int main()
{int a = 2; int b = 10;cout << !a << endl;cout << !!a << endl;a = 2; b = 2;cout << (a&&b)<< endl;cout << (a || b) << endl;a = 0; b = 3;cout << (a && b) << endl;cout << (a || b) << endl;a = 0; b = 0;cout << (a && b) << endl;cout << (a || b) << endl;return 0;system("pause");
}

四,程序流程結(jié)構(gòu)

順序,選擇,循環(huán)?
【C擼了不少了,就不仔細(xì)打了】

4.1 選擇結(jié)構(gòu)

1.0? IF——同C
2.0 三目運(yùn)算符:表達(dá)式?A:B,如果表達(dá)式為真,返回A,假返回B【返回的是變量,可以繼續(xù)賦值】
3.0 SWITCH——同C【結(jié)構(gòu)清晰,效率高,只能整型和字符型,BREAK】

#include <iostream>
using namespace std;
int main()
{int a = 9, b = 90;cout << (a > b ? a : b) << endl;(a > b ? a : b) = 78;//==78cout << a << endl;cout << b << endl;(a < b ? a : b) = 78;cout << a << endl;cout << b << endl;return 0;system("pause");
}
4.2 循環(huán)結(jié)構(gòu)

1.0 WHILE循環(huán)
【RAND()%100,%100表示生成隨機(jī)數(shù)的區(qū)間,0~99,0+1~99+1,rand()%100+1
可以用BREAK退出當(dāng)前循環(huán)
2.0 DO……WHILE循環(huán)

#include <iostream>
#include<ctime>
using namespace std;
int main()
{srand((unsigned int)time(NULL));//添加隨機(jī)數(shù)種子,作用:利用當(dāng)前系統(tǒng)時(shí)間生成隨機(jī)數(shù),防止每次隨機(jī)數(shù)都一樣int num=rand() % 100 + 1;cout << "請(qǐng)猜數(shù)字" << endl;int val;cin >> val;while(num!=val){if (num > val){cout << "猜小了" << endl;}else if (num < val){cout << "猜大了" << endl;}cin >> val;}cout << "恭喜猜對(duì)了,數(shù)字就是" <<val<< endl;return 0;system("pause");
}
#include <iostream>
#include<ctime>
using namespace std;
int main()
{int a = 0;do{cout << a << endl;a++;if (a == 10)break;} while (a);a = 0;while (a){cout << a << endl;a++;if (a == 10){break;}}return 0;system("pause");
}

3.0?FOR循環(huán)
???????4.0 嵌套循環(huán)——外層執(zhí)行一次,內(nèi)層執(zhí)行一周

#include <iostream>
#include<ctime>
using namespace std;
int main()
{for (int i = 0; i < 10; i++){for (int i = 0; i < 10; i++){cout << "* ";}cout << endl;}return 0;system("pause");
}

4.3 跳轉(zhuǎn)語句

1.0 break語句,跳出循環(huán),嵌套循環(huán)中可以是跳出內(nèi)循環(huán)

2.0 continue語句,結(jié)束本次,繼續(xù)下一次循環(huán)

http://www.risenshineclean.com/news/21779.html

相關(guān)文章:

  • 如何做視頻網(wǎng)站流程圖關(guān)于營銷的最新的新聞
  • 專做電器的網(wǎng)站域名注冊(cè)阿里云
  • 163企業(yè)郵箱收費(fèi)標(biāo)準(zhǔn)一年多少錢上海谷歌seo推廣公司
  • iis7.5 部署網(wǎng)站寄生蟲seo教程
  • 做素描的網(wǎng)站百度排名點(diǎn)擊軟件
  • wordpress插件更新保留修改寧波優(yōu)化推廣選哪家
  • 有沒有免費(fèi)做網(wǎng)站的百度電話客服24小時(shí)人工服務(wù)熱線
  • 得力文具網(wǎng)站建設(shè)策劃書2023搜索最多的關(guān)鍵詞
  • 武漢光谷新聞最新消息上海專業(yè)的seo推廣咨詢電話
  • 網(wǎng)站建設(shè)最貴服務(wù)商企業(yè)培訓(xùn)系統(tǒng)
  • 怎樣可以做網(wǎng)站培訓(xùn)機(jī)構(gòu)網(wǎng)站制作
  • 商城網(wǎng)站 報(bào)價(jià) 方案優(yōu)化建站
  • 公司門戶網(wǎng)站該怎么做seo建站營銷
  • 企業(yè)網(wǎng)站功能模塊長春做網(wǎng)站推廣的公司
  • 營銷型網(wǎng)站建設(shè)教學(xué)淘寶優(yōu)秀軟文范例100字
  • 億瑪酷網(wǎng)站建設(shè)域名注冊(cè)新網(wǎng)
  • 網(wǎng)絡(luò)營銷中自建網(wǎng)站平臺(tái)推廣方式
  • 鞍山建設(shè)局的網(wǎng)站seo快速排名系統(tǒng)
  • 專門做微信推送的網(wǎng)站廣東疫情動(dòng)態(tài)人民日?qǐng)?bào)
  • wordpress 多語言切換東莞seo排名外包
  • 做鉆石的網(wǎng)站如何推廣我的網(wǎng)站
  • quercus wordpress長沙網(wǎng)站優(yōu)化價(jià)格
  • 網(wǎng)站的做公司鄭州seo建站
  • 怎么讓百度搜索靠前北京seo工程師
  • .net網(wǎng)站設(shè)計(jì)seo技術(shù)優(yōu)化
  • 壽光網(wǎng)站建設(shè)湖南有實(shí)力seo優(yōu)化哪家好
  • 石家莊網(wǎng)站制作費(fèi)用搜索大全引擎入口
  • 東城建站推廣競(jìng)價(jià)排名的弊端
  • 北京網(wǎng)站開發(fā)網(wǎng)站建設(shè)seo引擎搜索
  • 網(wǎng)絡(luò)管理系統(tǒng)設(shè)備seo優(yōu)化公司信