//Задача 3
#include <iostream>
#include <stdio.h>
using namespace std;
string SubString(string str, int startIndex, int endIndex)
{
string output = "";
for (int i = startIndex; i < endIndex; i++)
output += str[i];
return output;
}
string ToString(int num)
char symbol = 0;
int tmp = num;
while(num != 0)
tmp = num % 10;
num /= 10;
symbol = (char)(tmp + 48);
output = symbol + output;
int IndexOf(string str, char symbol)
int index = -1;
for (int i = 0; i < str.length(); i++)
if (str[i] == symbol)
index = i;
break;
return index;
bool Contains(string text, char symbol)
for (int i = 0; i < text.length(); i++)
if (text[i] == symbol)
return true;
return false;
bool IsRepeat(string values, string num)
string tmp = "";
while (IndexOf(values, ' ') != -1)
values = SubString(values, IndexOf(values, ' ') + 1, values.length() + 1);
tmp = SubString(values, 0, IndexOf(values, ' '));
if (tmp == num)
int main()
const int arrSize = 10;
int arr[arrSize] = { 10, 22, 10, 76, 44, 22, 22, 12, 9, 76};
string values = "";
bool couples = false;
for (int i = 0; i < arrSize; i++)
string str = ToString(arr[i]);
for (int j = i + 1; j < arrSize; j++)
if (arr[i] == arr[j] && !IsRepeat(values, ToString(arr[j])))
str += " " + ToString(arr[j]);
values += " " + ToString(arr[j]);
if (Contains(str, ' '))
couples = true;
cout << "Couple: " << str << endl;
if (!couples)
cout << "Couple not detected!" << endl;
return 0;
--------------------------------------------------------------------------
//Задача 5
string ToLower(string text)
output += tolower(text[i]);
string str1 = "";
string str2 = "";
cout << "Enter first string: ";
getline(cin, str1);
cout << "Enter second string: ";
getline(cin, str2);
if (ToLower(str1) == ToLower(str2))
cout << endl << "Strings are equal" << endl;
else
cout << endl << "Strings are not equal" << endl;
###язык Python##
###1##
N=int(input())
if(N<32 and N%3!=0 or N<0):
print("YES")
else:
print("NO")
###2##
if(N%2==0 or N>400 and N<500):
###3##
if(len(str(N))==3 and str(N)[-1]=='9'):
###4##
if(N>=345 and N<543 or N%7==0):
###5##
if(N%3==0 or str(N)[-1]=='0'):
###6##
if(N%2==0 and int(str(N)[-2])>5):
###7##
if(N%2!=0 and len(str(N))==3):
##8##
a=int(input())
b=int(input())
if(int(str(a)[-4])>int(str(b)[-4])):
##9##
if(int(str(a)[-3])%2==0 and b%2!=0):
##10##
if(a%8>4 and b%12<5):
##11##
if(a%3!=0 and b%3!=0):
##12##
if((a*b)%3==0):
##13##
if(a%23<14 and b%22>15):
##14##
if(a%b==0 or b%a==0):
##15##
if(str(a)[-1]=='6' and str(b)[-4]=='6'):
//Задача 3
#include <iostream>
#include <stdio.h>
using namespace std;
string SubString(string str, int startIndex, int endIndex)
{
string output = "";
for (int i = startIndex; i < endIndex; i++)
output += str[i];
return output;
}
string ToString(int num)
{
string output = "";
char symbol = 0;
int tmp = num;
while(num != 0)
{
tmp = num % 10;
num /= 10;
symbol = (char)(tmp + 48);
output = symbol + output;
}
return output;
}
int IndexOf(string str, char symbol)
{
int index = -1;
for (int i = 0; i < str.length(); i++)
{
if (str[i] == symbol)
{
index = i;
break;
}
}
return index;
}
bool Contains(string text, char symbol)
{
for (int i = 0; i < text.length(); i++)
{
if (text[i] == symbol)
return true;
}
return false;
}
bool IsRepeat(string values, string num)
{
string tmp = "";
while (IndexOf(values, ' ') != -1)
{
values = SubString(values, IndexOf(values, ' ') + 1, values.length() + 1);
tmp = SubString(values, 0, IndexOf(values, ' '));
if (tmp == num)
return true;
}
return false;
}
int main()
{
const int arrSize = 10;
int arr[arrSize] = { 10, 22, 10, 76, 44, 22, 22, 12, 9, 76};
string values = "";
bool couples = false;
for (int i = 0; i < arrSize; i++)
{
string str = ToString(arr[i]);
for (int j = i + 1; j < arrSize; j++)
{
if (arr[i] == arr[j] && !IsRepeat(values, ToString(arr[j])))
{
str += " " + ToString(arr[j]);
values += " " + ToString(arr[j]);
}
}
if (Contains(str, ' '))
{
couples = true;
cout << "Couple: " << str << endl;
}
}
if (!couples)
cout << "Couple not detected!" << endl;
return 0;
}
--------------------------------------------------------------------------
//Задача 5
#include <iostream>
using namespace std;
string ToLower(string text)
{
string output = "";
for (int i = 0; i < text.length(); i++)
output += tolower(text[i]);
return output;
}
int main()
{
string str1 = "";
string str2 = "";
cout << "Enter first string: ";
getline(cin, str1);
cout << "Enter second string: ";
getline(cin, str2);
if (ToLower(str1) == ToLower(str2))
cout << endl << "Strings are equal" << endl;
else
cout << endl << "Strings are not equal" << endl;
return 0;
}
###язык Python##
###1##
N=int(input())
if(N<32 and N%3!=0 or N<0):
print("YES")
else:
print("NO")
###2##
N=int(input())
if(N%2==0 or N>400 and N<500):
print("YES")
else:
print("NO")
###3##
N=int(input())
if(len(str(N))==3 and str(N)[-1]=='9'):
print("YES")
else:
print("NO")
###4##
N=int(input())
if(N>=345 and N<543 or N%7==0):
print("YES")
else:
print("NO")
###5##
N=int(input())
if(N%3==0 or str(N)[-1]=='0'):
print("YES")
else:
print("NO")
###6##
N=int(input())
if(N%2==0 and int(str(N)[-2])>5):
print("YES")
else:
print("NO")
###7##
N=int(input())
if(N%2!=0 and len(str(N))==3):
print("YES")
else:
print("NO")
##8##
a=int(input())
b=int(input())
if(int(str(a)[-4])>int(str(b)[-4])):
print("YES")
else:
print("NO")
##9##
a=int(input())
b=int(input())
if(int(str(a)[-3])%2==0 and b%2!=0):
print("YES")
else:
print("NO")
##10##
a=int(input())
b=int(input())
if(a%8>4 and b%12<5):
print("YES")
else:
print("NO")
##11##
a=int(input())
b=int(input())
if(a%3!=0 and b%3!=0):
print("YES")
else:
print("NO")
##12##
a=int(input())
b=int(input())
if((a*b)%3==0):
print("YES")
else:
print("NO")
##13##
a=int(input())
b=int(input())
if(a%23<14 and b%22>15):
print("YES")
else:
print("NO")
##14##
a=int(input())
b=int(input())
if(a%b==0 or b%a==0):
print("YES")
else:
print("NO")
##15##
a=int(input())
b=int(input())
if(str(a)[-1]=='6' and str(b)[-4]=='6'):
print("YES")
else:
print("NO")