#define use_CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <cstring>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
const int N = 81;
const int N2 = 81;
int numbers[N];
int count = 0;
int count2 = 0;
string words[N];
string kwords[N2];
char the_string[N], * p;
char* next_token = nullptr;
int i = 0;
for (int k = 0; k < N; k++) {
numbers[k] = 0;
}
cout << "Введите строку:";
cin.getline(the_string, N); // начало ввода первого массива
p = strtok_s(the_string, " ", &next_token);
while (p != nullptr) {
words[i] = p;
i++;
p = strtok_s(nullptr, " ", &next_token);
count++;
} // конец ввода первого массива
cout << endl;
char the_string2[N2], * p2;
char* next_token2 = nullptr;
cout << "Введите нужные слова:";
cin.getline(the_string2, N2);
int j = 0;
p2 = strtok_s(the_string2, " ", &next_token2);
while (p2 != nullptr) {
kwords[j] = p2;
j++;
p2 = strtok_s(nullptr, " ", &next_token2);
count2++;
for (int i = 0; i < count; i++) {
for (int j = 0; j < count2; j++) {
if (words[i] == kwords[j]) {
numbers[j] = numbers[j] + 1;
break;
int t; string d;
for (int i = 0; i < count2; i++) {
if (numbers[i] < numbers[i + 1]) {
t = numbers[i + 1];
numbers[i+1] = numbers[i];
numbers[i] = t;
d = kwords[i + 1];
kwords[i + 1] = kwords[i];
kwords[i] = d;
cout << kwords[i] << " ";
return 0;
x, y = map(float, input().split())
# f - формула
f1 = f2 = f3 = f4 = False
F1 = (x-4)*(x-4) + (y-4)*(y-4)
F2 = x*x + (y-3)*(y-3)
F3 = (x-3)*(x-3)+y*y
if (x * x + y * y <= 25) and (x * x + y * y >= 9):
f1 = True
if ((x * x + y * y <= 25) and (y > x + 5)) or ((x * x + y * y <= 25) and (y < x - 5)) \
or ((x * x + y * y <= 25) and ((x > 0 and y > 0) or (x < 0 and y < 0))):
f2 = True
if F1 == 9 or F2 == 9 or F3 == 9 or ((F1 <= 9 and F2 > 9 and F3 > 9) or (F2 <= 9 and F1 > 9 and F3 > 9) or (F3 <= 9 and F1 > 9 and F2 > 9)):
f3 = True
if (x * x + (y - 3) * (y - 3) <= 16) and (y <= 2 or y >= 5):
f4 = True
print("1:", f1)
print("2:", f2)
print("3:", f3)
print("4:", f4)
#define use_CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <cstring>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
const int N = 81;
const int N2 = 81;
int numbers[N];
int count = 0;
int count2 = 0;
string words[N];
string kwords[N2];
char the_string[N], * p;
char* next_token = nullptr;
int i = 0;
for (int k = 0; k < N; k++) {
numbers[k] = 0;
}
cout << "Введите строку:";
cin.getline(the_string, N); // начало ввода первого массива
p = strtok_s(the_string, " ", &next_token);
while (p != nullptr) {
words[i] = p;
i++;
p = strtok_s(nullptr, " ", &next_token);
count++;
} // конец ввода первого массива
cout << endl;
char the_string2[N2], * p2;
char* next_token2 = nullptr;
cout << "Введите нужные слова:";
cin.getline(the_string2, N2);
int j = 0;
p2 = strtok_s(the_string2, " ", &next_token2);
while (p2 != nullptr) {
kwords[j] = p2;
j++;
p2 = strtok_s(nullptr, " ", &next_token2);
count2++;
}
cout << endl;
for (int i = 0; i < count; i++) {
for (int j = 0; j < count2; j++) {
if (words[i] == kwords[j]) {
numbers[j] = numbers[j] + 1;
break;
}
}
}
int t; string d;
for (int j = 0; j < count2; j++) {
for (int i = 0; i < count2; i++) {
if (numbers[i] < numbers[i + 1]) {
t = numbers[i + 1];
numbers[i+1] = numbers[i];
numbers[i] = t;
d = kwords[i + 1];
kwords[i + 1] = kwords[i];
kwords[i] = d;
}
}
}
cout << endl;
for (int i = 0; i < count2; i++) {
cout << kwords[i] << " ";
}
return 0;
}
x, y = map(float, input().split())
# f - формула
f1 = f2 = f3 = f4 = False
F1 = (x-4)*(x-4) + (y-4)*(y-4)
F2 = x*x + (y-3)*(y-3)
F3 = (x-3)*(x-3)+y*y
if (x * x + y * y <= 25) and (x * x + y * y >= 9):
f1 = True
if ((x * x + y * y <= 25) and (y > x + 5)) or ((x * x + y * y <= 25) and (y < x - 5)) \
or ((x * x + y * y <= 25) and ((x > 0 and y > 0) or (x < 0 and y < 0))):
f2 = True
if F1 == 9 or F2 == 9 or F3 == 9 or ((F1 <= 9 and F2 > 9 and F3 > 9) or (F2 <= 9 and F1 > 9 and F3 > 9) or (F3 <= 9 and F1 > 9 and F2 > 9)):
f3 = True
if (x * x + (y - 3) * (y - 3) <= 16) and (y <= 2 or y >= 5):
f4 = True
print("1:", f1)
print("2:", f2)
print("3:", f3)
print("4:", f4)