int main() { int a; cin >> a if(a%2 == 0) cout << "четное" << endl; else cout << "нечетное" << endl; }
4) #include <iostream>
using namespace std;
int main() { int a,b,c; string s = ""; cin >> a >> b >> c; if(a == b && a == c) cout << "равносторонний" << endl; else { if (a==b || a == c || b == c) s += "равнобедренный"; if( a*a == (b*b+c*c) || b*b == (a*a+c*c) || c*c == (a*a+b*b)) s+= "прямоугольный"; if(s == '') cout << "обычный" << endl; else cout << s << endl; } }
Pascal: const a:array [1..5,1..5] of integer = ((1,2,3,4,5), (6,7,8,9,10), (11,12,13,14,15), (16,17,18,19,20), (21,22,23,24,25)); var I,j:integer; begin for i:=1 to 5 do for j:=1 to 5 do write (a[I,j],' '); writeln; for i:=1 to 5 do begin for j:=1 to 5 do write (a[I,j]:3); writeln; end; readln; end.
C++: #include <iostream> #include <iomanip> using namespace std;
int main() { int a[5][5] = {{1,2,3,4,5}, {6,7,8,9,10}, {11,12,13,14,15}, {16,17,18,19,20}, {21,22,23,24,25},}; for (int I = 0; I<5; I++) for (int j = 0; j<5; j++) cout <<a[I][j] <<" "; cout <<endl; for (int I = 0; I<5; I++) { for (int j = 0; j<5; j++) cout <<setw(3) <<a[I][j]; cout <<endl; } return 0; }
ответ: ответ на питоне
for i in range(100,1000):
x = str(i)
if int(x[0]) == int(x[1])-1 == int(x[2])-2:
print(a)