#C++ Day2 Sep 10 2025

#include <iostream>

using namespace std;

#define X “Vito写算法”

#define Y “Deep Night”

int main() {

cout <<X <<endl <<Y<<endl ;

//define constant can substitute sth

}

#include <iostream>

using namespace std;

#define X “Vito写算法”

#define Y “Deep Night”

#define Z 1+2

#define G (1+2)

const int x = 8;

int main() {

cout <<X <<endl <<Y<<endl ;

cout << Z*Z<<endl; //would be 5,cause 1+2*1+2=5

cout << G * G<< endl; // would be 9,cause you add the ()

//x = (x + 1); //if add up the const ,this x can’t be modify

//c++ is  upper and lower case sensitive 

cout << x << endl;

}

#include <iostream>

using namespace std;

int main(){

//int float;//it is wrong because you can’t use the reserve key as the symbol

int a = 5;

if (a == 6) {

return -1;

}

return -2;

}

#include <iostream>

using namespace std;

int main() {

int a12_ = 520;

//int 9b_ = 22; //number can’t be the start of the literal

int a = 5;

int A = 8;

cout << a << endl << A <<endl;

int appleCount = 0;

int chuangshijiejing = 0; //pinyin can be normal if you are in the chinese group

#include <iostream>

using namespace std;

int main() {

int a12_ = 520;

//int 9b_ = 22; //number can’t be the start of the literal

int a = 5;

int A = 8;

cout << a << endl << A <<endl;

int appleCount = 0;

int chuangshijiejing = 0; //pinyin can be normal if you are in the chinese group

//variety Literal of C++

/*1.case sensitive

2.can not be started with number

3.can not be the system reserve literal

4.you can use word,number,_ as the variety Literal*/

}