If you cant use an array or string, then you need to calculate for each character:
This will print whatever you type in:
1 2 3 4 5
cout << "Please enter some things and then hit enter\n: ";
int ch;
while ((ch = cin.get()) != '\n')
cout << ch;
So number 1:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
cout << "Please enter some things and then hit enter\n: ";
int ch;
int atCount = 0;
while ((ch = cin.get()) != '\n')
{
switch(ch)
{
case'@': ++atCount; break;
// Add the other important character events here
}
}
if (atCount == 1) cout << "1 ok\n";