Объяснение:
var a,b,s,o:integer;
begin
o := 0;
writeln('введите количество секунд');
readln(a);
writeln('1.муж 2.жен');
readln(b);
s:=0;
if b = 1 then
if (a <= 400) and (s=0) then
o := 5;
s := s+1;
end;
if (a <= 500) and (s=0) then
o := 4;
if (a <= 600) and (s=0) then
o := 3;
if (a <= 700) and (s=0) then
o := 2;
end
else
if (a <= 800) and (s=0) then
writeln('оценка: ',o)
end.
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#pragma GCC optimize("Ofast")
#define ll long long
using namespace std;
ll digits(ll a){
if(a == 0)
return 1;
ll cnt = 0;
while(a > 0){
a /= 10;
cnt++;
}
return cnt;
int main() {
ll n;
cin >> n;
ll h = n/3600;
h %= 24;
n %= 3600;
ll m = n/60;
ll s = n % 60;
cout << h << ':';
if(digits(m) == 1)
cout << 0;
cout << m << ':';
if(digits(s) == 1)
cout << s;
на информатиксе 100 :)
Объяснение:
var a,b,s,o:integer;
begin
o := 0;
writeln('введите количество секунд');
readln(a);
writeln('1.муж 2.жен');
readln(b);
s:=0;
if b = 1 then
begin
if (a <= 400) and (s=0) then
begin
o := 5;
s := s+1;
end;
if (a <= 500) and (s=0) then
begin
o := 4;
s := s+1;
end;
if (a <= 600) and (s=0) then
begin
o := 3;
s := s+1;
end;
if (a <= 700) and (s=0) then
begin
o := 2;
s := s+1;
end;
end
else
begin
if (a <= 500) and (s=0) then
begin
o := 5;
s := s+1;
end;
if (a <= 600) and (s=0) then
begin
o := 4;
s := s+1;
end;
if (a <= 700) and (s=0) then
begin
o := 3;
s := s+1;
end;
if (a <= 800) and (s=0) then
begin
o := 2;
s := s+1;
end;
end;
writeln('оценка: ',o)
end.
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#pragma GCC optimize("Ofast")
#define ll long long
using namespace std;
ll digits(ll a){
if(a == 0)
return 1;
ll cnt = 0;
while(a > 0){
a /= 10;
cnt++;
}
return cnt;
}
int main() {
ll n;
cin >> n;
ll h = n/3600;
h %= 24;
n %= 3600;
ll m = n/60;
ll s = n % 60;
cout << h << ':';
if(digits(m) == 1)
cout << 0;
cout << m << ':';
if(digits(s) == 1)
cout << 0;
cout << s;
}
на информатиксе 100 :)