玄元一墨 发表于 2023-2-23 11:13:17

C++获取用户的输入


#include <iostream>
#include <string>

#define PHP_EOL "\n"

using namespace std;

int main()
{
    int a, b;

    // 获取用户输入的值
    cout << "请输入a的值" << endl;
    cin >> a;
    cout << "请输入b的值" << endl;
    cin >> b;

    // 输出用户的输入
    cout << "a的值是: " << a << "\t b的值是: " << b << endl;

    system("pause");

}


LEFT_Flamelight 发表于 2023-3-14 17:51:12

太简单了
页: [1]
查看完整版本: C++获取用户的输入