#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; }
mishagoride885
10.11.2021
// 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.
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;
}