1.头文件、命名空间
#include <iostream>
using namespace std;
2.输入输出
//输入
cin >> n1 >> n2;
//输出
cout<< n1 <<" "<<n2;//和字符串拼接
3.字符串string
使用方法和普通变量相同。
//定义
string str;
//输入、输出字符串
cin >>str;
cout <<str;
//判断
if(str=="hello" || str > str2 || str < str2)
//长度
int length = str.length();
4.使用库函数(stl)
//1.添加头文件
//eg:
#include <algorithm>
//2.使用方法
sort(array,array + n);
//补:万能头文件
#include<bits/stdc++.h>//vs2019第一次使用前需要单独配置