Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstring>
- #include <iostream>
- using namespace std;
- int main()
- {
- const int MAX = 80;
- unsigned int i = 0, j = 0;
- char str1[MAX], str2[MAX];
- char alphabet[26] = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','W','X','Y','Z'};
- bool del_mode = false;
- cout << "String: ";
- cin.getline(str1, MAX);
- ///4.2.1 Words, ending on rd
- for (i = 0; str1[i]; i++)
- {
- if (str1[i] == '(')
- del_mode = true;
- if (!del_mode)
- {
- str2[j] = str1[i];
- j++;
- }
- if (str1[i] == ')')
- del_mode = false;
- }
- str2[j] = '\0';
- cout << "Result: " << str2 << endl;
- ///
- cout << endl;
- for (i = 0; i < 26; i++)
- for (j = 0; j < strlen(str1); j++)
- if (str1[j] == alphabet[i] || str1[j] == tolower(alphabet[i]))
- {
- cout << alphabet[i];
- break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement