var a: integer;
procedure row(n:integer);
begin
if n>=1 then begin
write (n, ' ');
row(n-1)
end;
end;
begin
readln(a);
row(a);
end.
Var a:integer;
begin
write('a='); readln(a);
if a mod 5 = 0 then writeln('Yes') else writeln('No');
end.
Пример:
a=15
Yes
//Dev-C++ 4.9.9.2
#include <iostream>
using namespace std;
int main(){
int s1,m1,h1,s2,m2,h2;
cin>>h1>>m1>>s1>>h2>>m2>>s2;
s1=s1+m1*60+h1*3600;
s2=s2+m2*60+h2*3600;
cout<<s2-s1;
cin.get();
cin.get();
return 0;
}
#include<iostream>
using namespace std;
int main(){
int l,v1,v2,t;
cin>>l>>v1>>v2>>t;
int x1 = (t * v1)%l,x2 = (-t*v2)%l;
if(x1<0) x1=l-x1;
if(x2<0) x2=l+x2;
cout<<min(abs(x1-x2),abs(l-x1-x2));
}