#include <iostream>
#include <iomanip>
#include <limits>
#include <string>
using namespace std;
int main() {
int i = 4;
double d = 4.0;
string s = "HackerRank ";
// Declare second integer, double, and String variables.
int a;
double b;
string c;
// Read and save an integer, double, and String to your variables.
// Note: If you have trouble reading the entire string, please go back and review the Tutorial closely.
cin >> a;
cin >> b;
cin.get();
getline(cin, c);
// Print the sum of both integer variables on a new line.
cout << i + a << endl;
// Print the sum of the double variables on a new line.
cout << setiosflags(ios::fixed) << setprecision(1) << b << endl;
// Concatenate and print the String variables on a new line
// The 's' variable above should be printed first.
cout << s + c << endl;
return 0;
}
Hakerrank 第2天
最新推荐文章于 2022-10-03 21:26:55 发布