Darksider3

Wort-Zähler

Mar 1st, 2013
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. using namespace std;
  4. int main(int argc,char ** argv)
  5. {
  6.     int ln = strlen(argv[1]);
  7.     int anzahl=0;
  8.     const char * zeichen=" ";
  9.     char po =*zeichen;
  10.     for(int x=0;x < ln;x++)
  11.     {
  12.         if(argv[1][x] == po)
  13.         {
  14.             anzahl++;
  15.         }
  16.     }
  17.     cout << anzahl;
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment