Last active
December 11, 2015 08:38
-
-
Save Mitmischer/4574181 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <locale> | |
using namespace std; | |
int main() | |
{ | |
locale loc; | |
string t; | |
int anzahl =1; | |
cout << "Text = ?" << endl; | |
getline (cin, t); | |
for (int i=0; i<t.length(); i++) | |
{ | |
cout << toupper (t[i], loc); | |
if (t[i]==32) | |
{ | |
anzahl++; | |
cout << endl; | |
} | |
} | |
cout << endl; | |
cout << "Anzahl der Woerter = " << anzahl << endl; | |
getline(cin,t); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment