我的第一个C++程序
#include <iostream> //#include(预处理指令) iostream(所嵌入的头文件(cout,<<等操作的有关信息就是在该文件中声明的)) using namespace std; //针对命名空间的指令 int main(){ //int(返回值类型) main(主函数名,c++函数中有且只能有一个名为main的函数) cout << "Hello World!" << endl; //cout(输出流对象)<<(输出操作) endl(换行符) cout << "Welcome to C++!" << endl; return 0; //表示退出main()函数并以0为返回值,返回值为0表示函数结束 }
🗾C++程序需储存为后缀为.cpp格式的文件,才能正常运行。
🎑int i == int i == int
i
🏞注释:/*This is
good time.
come boy.*/
//到行尾结束
🌅I/O流
🌄I.
int a, b;
cin >> a >> b;
🌠O.
cout << "a+b=" << a+b << endl;
🎇🎆🌇🌆🏙🌃🌌🌉🌁
你要灿若星海

浙公网安备 33010602011771号