-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBasic Data Types.cpp
More file actions
37 lines (29 loc) · 813 Bytes
/
Copy pathBasic Data Types.cpp
File metadata and controls
37 lines (29 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* Input Format
Input consists of the following space-separated values: int, long, char, float, and double, respectively.
Output Format
Print each element on a new line in the same order it was received as input. Note that the floating point value should be correct up to 3 decimal places and the double to 9 decimal places.
Sample Input
3 12345678912345 a 334.23 14049.30493
Sample Output
3
12345678912345
a
334.230
14049.304930000
*/
#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;
int main() {
int a;
long b;
char c;
float d;
double e;
cin >> a >> b >> c >> d >> e;
cout << a << "\n" << b << "\n" << c << "\n";
cout << std::fixed << std::setprecision(3) << d << '\n';
cout << std::fixed << std::setprecision(9) << e << '\n';
return 0;
}