Procedure swap(var a, b: real); var t: real; begin t := a; a := b; b := t; end;
var a, b, c: real; begin readln(a, b, c); if (a > b) then swap(a, b); if (b > c) then swap(b, c); if (a > b) then swap(a, b); writeln(a, ' ', b, ' ', c); end.
Без процедур:
var a, b, c, t: integer; begin readln(a, b, c); if (a > b) then begin t := a; a := b; b := t; end; if (b > c) then begin t := b; b := c; c := t; end; if (a > b) then begin t := a; a := b; b := t; end; writeln(a, ' ', b, ' ', c); end.
var t: real;
begin
t := a;
a := b;
b := t;
end;
var a, b, c: real;
begin
readln(a, b, c);
if (a > b) then swap(a, b);
if (b > c) then swap(b, c);
if (a > b) then swap(a, b);
writeln(a, ' ', b, ' ', c);
end.
Без процедур:
var a, b, c, t: integer;
begin
readln(a, b, c);
if (a > b) then
begin
t := a;
a := b;
b := t;
end;
if (b > c) then
begin
t := b;
b := c;
c := t;
end;
if (a > b) then
begin
t := a;
a := b;
b := t;
end;
writeln(a, ' ', b, ' ', c);
end.
1 задача:
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a;
cin >> a;
if (a < 7) cout << "Yes";
else if (a > 10) cout << "No";
else cout << "Error";
return 0;
}
2 задача:
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b;
cin >> a >> b;
if (a > b) cout << "yes";
else {
long long c = a;
a = b;
b = c;
cout << a << ' ' << b << endl;
}
return 0;
}
3 задача:
#include <bits/stdc++.h>
using namespace std;
int main() {
long long a, b;
cin >> a >> b;
if (a * b >= 0) cout << "YES";
else cout << "NO";
return 0;
}