S SmartDocs
系列: C++ 4th cpp 12 行 · 更新于 2026-02-03

hello_world.cpp

C++_4th/Part_I_Introductory/Chapter_1_Notes_to_Reader/hello_world.cpp

#include <iostream>
#include <string>
using namespace std;
// Demonstrates basic C++ program structure and I/O
int main() {
    string name;
    cout << "Enter your name: ";
    cin >> name;
    cout << "Hello, " << name << "! Welcome to C++!" ;
    cout << "Have a nice day!" << endl;
    return 0;
}

相关文章