string z,s;
while (true)
{
cin>>z;
s+=z;
if(cin.peek()=='
')
break;
}
................................
OR/
.................................
string s;
getline(cin,s);
cin>>n;
cin.ignore();
cin.getline(cin,string,'
');
getline(cin, variable_name);
Code Example |
---|
Cpp :: declare nullptr c++ |
Cpp :: c++ fstream |
Cpp :: string to uint64_t c++ |
Cpp :: lambda c++ |
Cpp :: C++ Vector Iterator Syntax |
Cpp :: time of a loop in c++ |
Cpp :: remove from vector by value c++ |
Cpp :: factorial function c++ |
Cpp :: int main() { |
Cpp :: cpp string slice |
Cpp :: stack implementation using class in c++ |
Cpp :: remove specific element from vector c++ |
Cpp :: c++ average |
Cpp :: c++ min int |
Cpp :: c++ get line |
Cpp :: how to add c++14 in sublime text |
Cpp :: Find minimum maximum element CPP |
Cpp :: setw c++ |
Cpp :: c++ reverse string |
Cpp :: sort vector c++ |
Cpp :: c++ random generator |
Cpp :: C++ Increment and Decrement |
Cpp :: cpp detect os |
Cpp :: 31. Next Permutation leetcode solution in c++ |
Cpp :: C++ String Compare Example |
Cpp :: char to int in c++ |
Cpp :: abstraction in cpp |
Cpp :: vector from angle |
Cpp :: sum of first 100 natural numbers |
Cpp :: basic cpp |