猿人学第18题-jsvmp 洞察先机

This commit is contained in:
luzhisheng 2025-03-18 23:39:54 +08:00
parent 5119d4347d
commit f192f6695b
3 changed files with 52 additions and 0 deletions

10
cpp/CMakeLists.txt Normal file
View File

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.27)
project(cpp)
set(CMAKE_CXX_STANDARD 14)
include_directories(.)
add_executable(cpp
HelloWorld.cpp
HelloWorld.h)

26
cpp/HelloWorld.cpp Normal file
View File

@ -0,0 +1,26 @@
//
// Created by aiyin on 2024/3/21.
//
// 头文件 导入 iostream 库
#include<iostream>
// 主函数
//int main(){
// // std 命名空间,指明 cout 所指的命名空间
// std::cout << "Hello World" << std::endl;
//}
// 添加了 using namespace std; 就可以省略 std 命名空间
using namespace std;
//int main(){
// // std 命名空间,指明 cout输出 所指的命名空间
// cout << "Hello World" << endl;
//}
// cin 等待键盘输入
int main(){
// std 命名空间,指明 cout输出 所指的命名空间
cout << "Hello World" << endl;
cin.get();
}

16
cpp/HelloWorld.h Normal file
View File

@ -0,0 +1,16 @@
//
// Created by aiyin on 2024/3/21.
//
#ifndef CPP_HELLOWORLD_H
#define CPP_HELLOWORLD_H
namespace HelloWorld {
class HelloWorld {
};
} // HelloWorld
#endif //CPP_HELLOWORLD_H