Здесь Вы можете найти ответы на многие вопросы или задать свой вопрос!
#include < iostream> #include < clocale> #include < cmath> using namespace std; void main(){ setlocale(lc_ctype,"rus"); int x, sum=0; cout< < "введите переменную: "; cin> > x; for(int i=1; i< x; i++) { if(x%i==0) sum+=i; } if(x==sum) {cout< < "это совершенное число"< < endl; } else {cout< < "это несовершенное число"< < endl; }}
до перелива 8 0 0
1) 3 5 0
2) 3 2 3
3) 6 2 0
4) 6 0 2
5) 1 5 2
6) 1 4 3
7) 4 4 0
n=get()k=0s=0while n> =1 do s=s+n % 10 k=k+1 n=(n-n%10)/10endprint(s,k)
(делаю масив 10на10)
program matrix;
var a: array [1..10,1..10] of integer;
i,q,b,f: integer;
begin
b: =0; f: =0; q: =1;
for i: =1 to 10 do begin a[i,q]: =1; end;
i: =1;
for q: =1 to 10 do begin a[i,q]: =1; end;
for i: =2 to 10 do
for q: =2 to 10 do
b: =q-1;
f: =i-1;
a[i,q]: =a[i,b]+a[f,q];
end; end;
readln
end.
Популярные вопросы