摘要:
#include <iostream> using namespace std; int main() { //逻辑运算符!非,真变假,假变真 int a = 10; cout << !a << endl;//在c++中,除了0都为真 cout << !!a << endl; system("pau 阅读全文
摘要:
#include <iostream> using namespace std; int main() { //比较运算符 int a = 10; int b = 20; //== cout << (a == b) << endl;//a等于b,结果0 //!= cout << (a != b) < 阅读全文
摘要:
#include <iostream> using namespace std; int main() { //赋值运算符; // = int a = 10; a = 100;//赋值 cout << "a=" << a << endl; // += a = 10; a += 2;//a=a+2; 阅读全文
摘要:
#include <iostream> using namespace std; int main() { //1.前置递增; int a = 10; ++a;//让变量+1 cout <<"a="<< a << endl; //2.后置递增; int b = 10; b++;//让变量+1 cou 阅读全文
摘要:
#include <iostream> using namespace std; int main() { //取模运算,就是求余数,运算符% int a = 10; int b = 3; cout << a % b << endl; int a2 = 10; int b2 = 20; cout < 阅读全文
摘要:
#include <iostream> using namespace std; int main() { //加减乘除 int a = 10; int b = 3; cout << a + b << endl; //加 cout << a - b << endl; //减 cout << a * 阅读全文
摘要:
#include <iostream> #include <string> using namespace std; int main() { //1.整数 int num1 = 0; cout << "请输入整型变量num1赋值" << endl; cin >> num1; cout << "整型 阅读全文
摘要:
#include <iostream> using namespace std; int main() { //1.创建bool类型 bool flag = true; //true代表真 bool flag1 = false; //false代表假 cout <<flag<< endl; //本质 阅读全文
摘要:
#include <iostream> #include <string> using namespace std; int main() { //1.C风格字符串 //注意事项char字符串名[] //注意事项等号后面双引号 char str[] = "C语言风格"; cout << str << 阅读全文
摘要:
#include <iostream> using namespace std; int main() { //转义字符 //换行符\n cout << "你好啊\n学生"; //反斜杠\\ cout << "\\" << endl; //水平制表符\t 作用整齐 cout << "aaa\thel 阅读全文
摘要:
阅读全文