#include < stdio.h> # define in "input.txt"# define out "output.txt"unsigned long long sum(int n){unsigned long long otv=0; for (int i=1; i*i< =n; i++)if %i)){otv+=i; if(i*i! =n)otv+=n/i; }return otv; }int main(void){unsigned long long n,otv=0; freopen(in,"r",stdin); freopen(out,"w",stdout); scanf("%i64d",& n); otv=sum(n); printf("%i64d",otv); return 0; }
Ответ дал: Гость
вот проверила, так работает. нормально?
program maxmin; var a, b, c: integer; max, min: integer; beginwriteln('введите три числа.'); read(a,b,c); {вводи числа через пробел}max: =a; if(b> max) then max: =b; if(c> max) then max: =c; min: =a; if(b< min) then min: =b; if(c< min) then min: =c; writeln('разность наибольшего и наименьшего чисел равна ',max-min); end.
Ответ дал: Гость
var a,b,c,d: integer;
begin
writeln ('vvedite a');
read(a);
writeln ('vvedite b');
read(b);
writeln ('vvedite c');
read(c);
writeln ('vvedite d');
read(d);
if (a> b) and (a> c) and (a> d) then writeln('samoe bolshoe chislo - a')
else writeln('a ne samoe bolshoe');
end.
Ответ дал: Гость
program chislo;
var n,delit,count,ccount: integer; beginread(n); count: =0; ccount: =0; for delit: =1 to n doif n mod delit = 0 thenbegincount: =count+1; if (delit mod 2 = 0) then ccount: =ccount+1; end; writeln('делителей: ',count); writeln('четных делителей: ',ccount); end.
Популярные вопросы