Files
learn_cpp/cin数据输入.cpp
2026-02-28 17:05:12 +08:00

26 lines
609 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// Created by viole on 2026/2/25.
//
#include <iostream>
#include "windows.h"
using namespace std;
int main() {
SetConsoleOutputCP(CP_UTF8);
string name;
double height;
int age;
cout << "请输入你的姓名:" <<endl;
cin >> name;
cout << "请输入你的身高cm:" <<endl;
cin >> height;
cout << "请输入你的年龄:" <<endl;
cin >> age;
cout << "--------"<<endl;
cout << "信息输入完成,您的信息如下:"<<endl;
cout<<"姓名:"<<name<<endl;
cout<<"身高:"<<height<<endl;
cout<<"年龄:"<<age<<endl;
return 0;
}