mirror of
http://106.12.3.193:3000/violeteverisland/learn_cpp.git
synced 2026-03-08 01:27:33 +08:00
12
This commit is contained in:
23
赋值运算符.cpp
Normal file
23
赋值运算符.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Created by violet on 2026/2/28.
|
||||
//
|
||||
#include "iostream"
|
||||
using namespace std;
|
||||
int main() {
|
||||
int num =2,num1,num2,num3,num4,num5;
|
||||
num +=3;cout<<num<<endl;
|
||||
bool a = true;
|
||||
cout<<a<<endl;
|
||||
|
||||
|
||||
num -=2,cout<<num<<endl,
|
||||
num *=2,cout<<num<<endl,
|
||||
num /=3,cout<<num<<endl,num %=2,cout<<num<<endl;
|
||||
int money = 50;
|
||||
money-=5;
|
||||
money+=10;
|
||||
money-=2;
|
||||
money*=2;
|
||||
cout<<money<<endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user