-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpp.cpp
50 lines (42 loc) · 1.03 KB
/
cpp.cpp
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
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>
#include<string>
#include <iomanip>
#include <limits>
using namespace std;
int main()
{
int i = 4;
double d = 4.0;
string s = "HackerRank ";
int input;
string input2;
double input1;
cin >> input;
fflush(stdin);
cin >> input1;
fflush(stdin);
cin >> input2;
fflush(stdin);
getline(cin,input2);
double add = input1 + d;
cout << input + i << endl;
cout <<setprecision(1)<< add << endl;
cout << s<<input2;
return 0;
}
// int i2;
// double d2;
// string s2;
// // Read and save an integer, double, and String to your variables.
// cin >> i2;
// cin >> d2;
// getline(cin >> ws, s2); // eat whitespace
// // Print the sum of both integer variables on a new line.
// cout << i + i2 << endl;
// // Print the sum of the double variables on a new line.
// cout << fixed <<setprecision(1) << d + d2 << endl;
// //
// // Concatenate and print the String variables on a new line
// // The 's' variable above should be printed first.
// cout << s + s2 << endl;
// }