Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- #include <iostream>
- #include <string>
- #include <Windows.h>
- const int N = 10;
- int Contrast(char str1[N], char str2[N])
- {
- int a = 0, b = 0;
- char alf[] = { 'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я' };
- char ALF[] = { 'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я' };
- for (int i = 0; i < N; i++)
- {
- for (int j = 0; j < 33; j++)
- {
- if (str1[i] == alf[j])
- {
- a == j;
- }
- else if (str1[i] == ALF[j])
- {
- a == j;
- }
- if (str2[i] == alf[j])
- {
- b == j;
- }
- else if (str2[i] == ALF[j])
- {
- b == j;
- }
- if (a != b)
- {
- cout << "Строчки разные!" << endl;
- return 0;
- }
- }
- }
- cout << "Строчки одинаковые! " << endl;
- return 0;
- }
- int main()
- {
- char str1[N], str2[N];
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- cout << "Введите первую строку:";
- cin >> str1 ;
- cout << "Введите вторую строку:";
- cin >> str2 ;
- Contrast(str1, str2);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment