Quote:
Originally posted by Valmont Yes offcourse there is a way. You gave the solution basically yourself. I'll do it later. In the mean time see how far you can get. |
am i on the right track here?
Code:
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string letters;
string input;
unsigned count(0);
for(;;)
{
//Use getline so spaces and tabs are counted in.
getline(cin, input, '\n');
if(input[0] == '@') //@ terminates the input sequence.
break;
else
{
//Add only ONE single letter. Ignore the rest.
letters=input.size;
}
}
cout<<letters<<endl;
system("PAUSE");
return 0;