#include <bits/stdc++.h>
using namespace std;
int main()
{ int a,b,mx;
cin >> a >> b;
if (a>b) cout << (a-b); else
cout << (b-a);
}
#include <iostream>
using namespace std;
int main(){
int now = 1; //tekushee chislo
for(size_t i = 0; i < 10; i++)
{ cout << now << " " << now * now << " " << now * now * now << endl; //vivodim chislo, kvadrat i kub
now += i + 1; //nahodim sledujushee
}
return 0;}<span>
</span>
//Pascal ABC.NET v3.1 сборка 1219
//Как я понял, количество очков случайно
Var
a,i,s:integer;
begin
randomize;
for i:=1 to 5 do
begin
a:=random(11);
writeln(i,' выстрел -',a);
s:=s+a;
end;
writeln('Сумма=',s);
if s=50 then writeln('Идет с Зиночкой в ресторан') else writeln('На тренировку в тир');
end.
Пример работы программы:
1 выстрел -3
2 выстрел -10
3 выстрел -7
4 выстрел -8
5 выстрел -0
Сумма=28
На тренировку в тир
var
i,n:integer;
s:real;
begin
repeat
write ('N = ');readln(n);
until (n>0);
s:=0;
for i:=1 to n do s:=s+1/i;
writeln ('S = ',s:0:4);
readln;
end.
A:=x+1/x-1
b:=a;
for i:=1 to x do b:=b*a;
b:=b+18*x*(y*y);