Возможный вариант в C++ #include <iostream> int main() { using namespace std; int N; cout << "Enter N: "; cin >> N; int num; int max = 1; int i; for (i = 0; i < N; ++i) { cout << "Enter #" << i + 1 << " number: "; cin >> num; if ((num - 9) % 10 != 0 && num % 3 == 0) { max = num; break; } } for (int j = i + 1; j < N; ++j) { cout << "Enter #" << j + 1 << " number: "; cin >> num; if ((num - 9) % 10 != 0 && num % 3 == 0) if (num > max) max = num; } if (max != 1) cout << "Max number div by 3 and don't end 9: " << max << endl; else cout << "No numbers div by 3 and don't end 9" << endl; return 0; }
{Проверка на существование треугольника} if ((a+b)>c) and ((a+c)>b) and ((b+c)>a) then Begin if ((a=b)or (b=c) or (a=c)) then Writeln('Треугольник равнобедренный');
if ((a=b) and (b=c)) then Writeln('Треугольник равносторонний') else Writeln('Треугольник разносторонний');
if ((a*a+b*b = c*c) or (a*a+c*c = b*b) or (b*b+c*c = a*a)) then Writeln('Треугольник прямоугольный'); end else Writeln('Треугольник нельзя построить');
#include <iostream>
int main()
{
using namespace std;
int N;
cout << "Enter N: ";
cin >> N;
int num;
int max = 1;
int i;
for (i = 0; i < N; ++i)
{
cout << "Enter #" << i + 1 << " number: ";
cin >> num;
if ((num - 9) % 10 != 0 && num % 3 == 0)
{
max = num;
break;
}
}
for (int j = i + 1; j < N; ++j)
{
cout << "Enter #" << j + 1 << " number: ";
cin >> num;
if ((num - 9) % 10 != 0 && num % 3 == 0)
if (num > max)
max = num;
}
if (max != 1)
cout << "Max number div by 3 and don't end 9: " << max << endl;
else
cout << "No numbers div by 3 and don't end 9" << endl;
return 0;
}
uses crt;
Var a,b,c:integer;
Begin
Write('Введите 1-ю сторону: '); Readln(a);
Write('Введите 2-ю сторону: '); Readln(b);
Write('Введите 3-ю сторону: '); Readln(c);
{Проверка на существование треугольника}
if ((a+b)>c) and ((a+c)>b) and ((b+c)>a) then
Begin
if ((a=b)or (b=c) or (a=c)) then
Writeln('Треугольник равнобедренный');
if ((a=b) and (b=c)) then
Writeln('Треугольник равносторонний')
else Writeln('Треугольник разносторонний');
if ((a*a+b*b = c*c) or (a*a+c*c = b*b) or (b*b+c*c = a*a)) then
Writeln('Треугольник прямоугольный');
end
else Writeln('Треугольник нельзя построить');
Readln();
END.