0

So I tried getline to get string input. But somehow the compiler ignores my getline part so that I can't give my program an input. I don't know why. Here is the code:

#include <bits/stdc++.h>

using namespace std;

int main(){

    int i = 4;
    double d = 4.0;
    string s = "HackerRank ";

    int c;
    double e;
    string f;

    cin >> c >> e;
    getline(cin ,f);

    cout << i+c << "\n" 
    << fixed << setprecision(1) << d+e << "\n";

    cout << s + f;
    return 0;
}
김선달
  • 931
  • 3
  • 18
Kedog
  • 29
  • 1

0 Answers0