Begin writeln('Введите первое число'); readln(a); writeln('Введите второе число'); readln(b);
if (a<0) and (b<0) then Begin a:=a+2; b:=b+2; writeln('a = ',a); writeln('b = ',b); end else if (a>0) and (b<0) then writeln('a*b = ',a*b) else if (a<0) and (b>0) then writeln('b-a = ', b-a)
Возможный вариант в 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; }
uses crt;
var a,b:real;
Begin
writeln('Введите первое число');
readln(a);
writeln('Введите второе число');
readln(b);
if (a<0) and (b<0)
then
Begin
a:=a+2;
b:=b+2;
writeln('a = ',a);
writeln('b = ',b);
end
else
if (a>0) and (b<0)
then
writeln('a*b = ',a*b)
else
if (a<0) and (b>0)
then
writeln('b-a = ', b-a)
else writeln('Ни одно условие не выполняется');
readln;
end.
#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;
}