题解 | 复读机
复读机
https://www.nowcoder.com/practice/9d381551b6ab40c4b5c3c8d60fe4066e
题干解读:题中要求的是对于5种不同数据类型的数进行输入和输出的操作,考察的是对于数据类型的理解和使用
思路:根据题意合理地使用不同地数据结构即可.
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
int a;
cin>>a;
cout<<a<<endl;
long b;
cin>>b;
cout<<b<<endl;
float c;
cin>>c;
cout<<fixed<<setprecision(1)<<c<<endl;
char d;
cin>>d;
cout<<d<<endl;
string e;
cin>>e;
cout<<e;
}

