I want to exit a loop if press enter in codeblocks(c++). So this is my code
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s="";
char ch;
while(1)
{
cin>>ch;
s+=ch;
}
cout<<s<<endl;
return 0;
}
Aucun commentaire:
Enregistrer un commentaire