C++学习
MH的代码
这个作者很懒,什么都没留下…
展开
-
整型变量的定义、浮点型变量、常量、枚举型常量
目录3_9整型变量的定义3_10浮点型变量3_11常量3_12枚举型常量3_9整型变量的定义#include <iostream>using namespace std;int main(){ int a=-1; unsigned b=-2; short c=-3; long d=-4; unsigned long e; e=a+b+c+d; cout<<"a:"<<a<<"\n"<<"b:"<原创 2021-10-31 02:03:42 · 1155 阅读 · 0 评论 -
布尔型变量、字符型变量、wchar_t双字节型变量
目录3_4布尔型3_5字符型3_6双字节型3_4布尔型1.布尔型变量克表示两个逻辑值,1和0,即真或者假。(来自书上)2.C++中true用来代表1,false用来代表0。(来自书上)#include <iostream>using namespace std;int main(){ bool check; check=true; if (check==true) { cout<<"Good!"; } return 0;}原创 2021-10-30 02:15:27 · 641 阅读 · 0 评论