知识库

C++语言开发示例:09. 输入数字

2025-02-01 20:24:12 李腾 1 次阅读

numstr.cpp

#include <iostream>

int main()
{
    using namespace std;
    cout << "What year was your house built?\n";
    int year;
    cin >> year;
    cout << "What is its street address?\n";
    char address[80];
    cin.getline(address, 80);
    cout << "Year built: " << year << endl;
    cout << "Address: " << address << endl;
    cout << "Done!\n";
}
转载请注明转自www.hylab.cn,原文地址:C++语言开发示例:09. 输入数字

评论 (0)

登录后发表评论

暂无评论,快来发表第一条评论吧!