View Single Post
Old 10-13-2004, 08:01 PM   #27 (permalink)
Androto
Mac Os X User(I hate win)
 
Join Date: Oct 2004
Posts: 138
Androto is on a distinguished road
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;

Last edited by Valmont; 10-14-2004 at 06:23 AM.
Androto is offline   Reply With Quote