var n:integer;
begin
readln (n);
if n mod 2 = 0 then write(n+2)
else write(n+1)
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
using namespace std;
int main() {
int n, i;
cin >> n;
i = n + 1;
if ( i % 2 == 0) {
cout << i;
}
else {
cout << n + 2;
}
return 0;
}
не оч красиво, но работает
var n:integer;
begin
readln (n);
if n mod 2 = 0 then write(n+2)
else write(n+1)
end.
if n % 2 == 0:
print (n + 2)
else: print (n +1)