cout<<"Количество десятков в вашем числе = "<<otvet<<endl;
}
Владимирович
28.03.2020
N1 var a, b: integer;
• begin
• readln(a, b);
• a := a mod 2; b := b mod 2; • if (b > 0) and (a > 0) then
• writeln ('четных чисел нет')
• else
• writeln ('четное число есть'); end.
N2
#include <iostream>
using namespace std;
int main() { int a; cin >> a; if(a < 100 || a > 999) cout << "Неверное число" << endl; else { int a1 = a/100; int a2 = (a/10)%10; int a3 = a%10; if(a1%2==a2%2==a3%2==0) cout << "Да" << endl; else cout << "Нет" << endl; } return 0; }
sergeykirushev
28.03.2020
1. Традиционное решение
const n=10; var x,y:array[1..n] of integer; sx,sy,i:integer; begin Randomize; Write('X: '); sx:=0; for i:=1 to n do begin x[i]:=Random(101)-50; Write(x[i],' '); sx:=sx+x[i] end; Writeln; Write('Y: '); sy:=0; for i:=1 to n do begin y[i]:=Random(101)-50; Write(y[i],' '); sy:=sy+y[i] end; Writeln; Writeln('Сумма х= ',sx,', сумма y= ',sy); if sx>sy then for i:=1 to n do y[i]:=0 else for i:=1 to n do x[i]:=0; Write('X: '); for i:=1 to n do Write(x[i],' '); Writeln; Write('Y: '); for i:=1 to n do Write(y[i],' '); Writeln end.
#include<iostream>
using namespace std;
int main()
{
cout<<"Введите двузначное число: "<<endl;
int number;
cin>>nuber;
int otvet = number / 10;
cout<<"Количество десятков в вашем числе = "<<otvet<<endl;
}