Const m=10; n=6; var a:array[1..10,1..6] of integer; i,j:integer; begin Writeln('Элементы массива'); for i:=1 to m do begin for j:=1 to n do begin a[i,j]:=sqr(i)+sqr(j); Write(a[i,j]:4) end; Writeln end end.
const n = 10; var a: array[1..n] of integer; i, t: integer;
begin Randomize; Writeln('Элементы массива'); for i := 1 to n do begin a[i] := Random(50); Write(a[i]:3); end; Writeln; t:=a[n]; for i:=n-1 downto 1 do a[i+1]:=a[i]; a[1]:=t; Writeln('Результирующий массив'); for i := 1 to n do Write(a[i]:3); Writeln end.
#include <iostream>
#include <cmath>
using namespace std;
int function(float *pointer1, float *pointer2)
{
float ch1, ch2;
ch1 = powf(*pointer1, 2);
ch2 = powf(*pointer2, 2);
cout<<"Квадрат первого числа равен:"<<ch1<<endl;
cout<<"Квадрат второго числа равен:"<<ch2<<endl;
return(0);
}
int main()
{
setlocale(LC_ALL, "RUS");
float a, b;
float *pointer1;
float *pointer2;
cout<<"Введите первое число:";
cin>>a;
cout<<"Введите второе число:";
cin>>b;
pointer1 = &a;
pointer2 = &b;
function(&a,&b);
system("PAUSE");
}