Var A,i : Longint; Begin Readln(A); For i:=1 to A do If A mod i = 0 then Writeln(i); end.
Манько_Панферов
08.07.2020
#include <iostream> using namespace std; void main () { int a,b; cin>>a>>b; int temp; if (a>b) {temp = b; b=a; a= temp; } cout<< "ves' diapozon"<<endl; for (int i = a; i<=b; i++) {
cout<< i<<" "; } cout<<endl; cout<< "chetnye"<<endl; for (int i = a; i<=b; i++) { if ( (i%2)==0) cout<< i; } cout<<endl; cout<< "ne chetnye"<<endl; for (int i = a; i<=b; i++) { if ( (i % 2) !=0) cout<< i<<" "; } cout<<endl; cout<< "krany 7"<<endl; for (int i = a; i<=b; i++) { if( (i%7)==0) cout<< i; } system("pause"); return 0; }
Voshchula David393
08.07.2020
// PascalABC.NET 3.0, сборка 1128 begin var m:=ReadInteger('Число строк:'); var n:=ReadInteger('Число колонок'); var a:=MatrixRandom(m,n,-10,20); Writeln('Сгенерированный массив'); for var i:=0 to m-1 do begin for var j:=0 to n-1 do Write(a[i,j]:4); Writeln end; Writeln('Найденные суммы'); for var i:=0 to m-1 do begin var avg:=0.0; for var j:=0 to n-1 do avg+=a[i,j]; avg/=n; var s:=0; for var j:=0 to n-1 do if a[i,j]>avg then s+=a[i,j]; Write(s,' ') end; Writeln end.
Begin
Readln(A);
For i:=1 to A do If A mod i = 0 then Writeln(i);
end.