#include <bits/stdc++.h>
using namespace std;
int main()
{
//亿 8个0
long long a = 2200000000; //爆炸
// long long -922亿亿 922亿亿
// int -21亿 - 21亿
cout << a << endl;
float f = 4.545545454545;
cout << fixed << setprecision(8) << f << '\n'; //精度不够
char c = 'A' + 32; //tab键 = 4个空格
cout << c << '\n';
bool b = 0;//逻辑变量
cout << b ;
long long x = 900.5; //隐式转换 (int)强制转换
cout << x;
int a = (!0) * 2;
cout << a;
return 0;
}
分支结构
// //单分支 如果... 那么
// if(){ }
//
// //双分支 如果...那么, 否则else... 必须要跟就近的if匹配
// if(){
//
// }else{
//
// }
int a = 1 ,b=0;
if(a == 1){
cout <<"1";
if(!b) {
cout << "yes";
}else {
cout << "no";
}
}
—— 本文来自火龙信奥(义乌睿码科技):义乌青少年信息学奥赛与编程教育平台,专注 CSP-J/S、NOIP、GESP 竞赛培训,线上线下融合教学,助力编程升学。网址:hlcoding.com