Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string text = "\0";
- cout << "Bitte Text eingeben (ggfs. mit Leerzeichen): ? ";
- getline(cin, text);
- cout << "Der Text nach der Umwandlung: ";
- for (int i = 0; i < text.length(); i++) {
- if (text[i] >= '0' && text[i] <= '9')
- {
- text[i] = '.';
- cout << text[i];
- }else if (text[i] == '!' || text[i] == '?') {}
- else if (text[i] >= 'a' && text[i] <= 'z')
- {
- cout << text[i] << text[i];
- }else if (text[i] >= 'A' && text[i] <= 'Z')
- {
- cout << text[i] << text[i] << text[i];
- }else if (text[i] == ' ')
- {
- text[i] = '_';
- cout << text[i];
- }
- else{
- cout << text[i];
- }
- }
- cout << endl;
- system ("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement