#include<iostream>
#include<string>
using namespace std;
int main()
{
char a;
while(cin.get(a)&&a!='\n')
{
cout<<a;
}
return 0;
}

Hubert's Coding Notes
Useful notes for CS people
#include<iostream>
#include<string>
using namespace std;
int main()
{
char a;
while(cin.get(a)&&a!='\n')
{
cout<<a;
}
return 0;
}