Using System;
namespace chislaabc
{
class Program
{
static void Main(string[] args)
{
int a, b, c;
Console.WriteLine(“Введите число a”);
a = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“Введите число b”);
b = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“Введите число c”);
c = Convert.ToInt32(Console.ReadLine());
if (a == b || a == c || b == c)
{
Console.WriteLine(«Есть хотя бы одна противоположная пара»);
}
else
{
Console.WriteLine(«Противоположных чисел нет»);
}
Console.ReadKey();
}
}
}
1) #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> arr;
int N;
int sum = 0;
cin >> N;
for(int i = 0; i<N; ++i) {
int temp;
cin >> temp;
arr.push_back(temp);
if(i==0) {
sum = arr[i];
} else {
sum*=arr[i];
}
cout << "Sum: " << sum;
}
2) #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> arr;
int N;
cin >> N;
int sum2(0), sum3(0);
for(int i = 0; i<N; ++i) {
int temp;
cin >> temp;
arr.push_back(temp);
if(arr[i]>9&&arr[i]<100) {
if(sum2==0) {
sum2=arr[i];
} else {
sum2*=arr[i];
}
} else {
if(arr[i]>99&&arr[i]<1000) {
sum3+=arr[i];
}
}
}
cout << "Sum2: " << sum2 << endl << "Sum3: " << sum3;
}
k = int(input('Введите кол-во пассажиров: '))
s = int(input('Введите стоимость билета: '))
profit = k * s
i = 0
while True:
i += 1
s *= 1.14
k *= 0.98
print(s * k)
if s * k / profit >= 1.5:
break
print(i)