![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
Sam Chou
这个作者很懒,什么都没留下…
展开
-
C++——循环结构
1、循环结构-while语句#include<iostream>using namespace std;int main(){ //while循环 //在屏幕中打印0 ~ 9 这10个数字 //int num = 0; //cout << num << endl; //num++; //cout << num << endl; //num++; //cout << num << endl;原创 2022-03-08 22:22:20 · 567 阅读 · 0 评论 -
C++——程序流程结构
1、程序流程结构-选择结构-单行if语句#include<iostream>using namespace std;int main(){ //选择结构 单行if语句 //用户输入分数,如果分数大于600,视为考上一本大学,在屏幕上输出 //1、用户输入分数 int score = 0; cout << "请输入一个分数:" << endl; cin >> score; //2、打印用户输入的分数 cout <<原创 2022-01-04 22:00:18 · 588 阅读 · 0 评论 -
C++——运算符
1、运算符-算数运算符-加减乘除运算#include<iostream>using namespace std;int main() { //加减乘除 int a1 = 10; int b1 = 3; cout << a1 + b1 << endl; cout << a1 - b1 << endl; cout << a1 * b1 << endl; cout << a1 / b1 &原创 2021-07-05 22:15:42 · 244 阅读 · 0 评论 -
C++ Primer Plus——2.7编程练习
//编写一个C++程序,它显示您的姓名和地址#include <iostream>using namespace std;int main(){ cout << "my name is your father" << endl; cout << "my home in sky" << endl; system("pause"); return 0;}...原创 2021-05-24 15:31:50 · 276 阅读 · 0 评论 -
C++——数据类型
1、数据类型-整型#include <iostream>using namespace std;int main(){ //整型 //1、短整型(-32768 ~ 32767) short num1 = 32768; //2、整型 int num2 = 32768; //3、长整型 long num3 = 10; //4、长长整型 long long num4 = 10; cout << "num1 = " << num1 <原创 2021-05-21 17:26:34 · 129 阅读 · 0 评论 -
C++——C++基础入门
#include <iostream>using namespace std;int main(){ cout << "Hello C++ !" << endl; system("pause"); return 0;}原创 2021-05-21 10:00:04 · 142 阅读 · 0 评论