Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- setlocale(LC_CTYPE, "Russian");
- int i = 0, y, trig1 = 0, trig2, l1 = 0, len = 0;
- char S[500], S1[500];
- cout << "Введите строку: ";
- cin >> S;
- cout << "Введите слово: ";
- cin >> S1;
- do
- {
- y = 0;
- trig2 = 0;
- do
- {
- if (S[i] == S1[y]) { l1++; }
- if (S1[y] == '\0') trig2 = 1;
- if (i == 0) len++;
- y++;
- } while (trig2 == 0);
- i++;
- if (S[i] == '\0') trig1 = 1;
- } while (trig1 == 0 || trig2 == 0);
- if (len-1 <= l1) cout << "Все буквы слова есть в предложении\n";
- else cout << "Не все буквы есть в предложении\n";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement