ответ:
#include "stdafx.h"
#include
using namespace std;
struct complex // структура "хранения" комплексного числа
{ float re; // действительная часть
float im; // мнимая часть
};
void print( char * txt, complex x) // вывод комплексного числа
{
printf("%s=(%f,%fi)", txt, x.re, x.im);
return;
};
complex new_complex(float a, float b) // задать значение комплексному числу
{ complex temp;
temp.re=a;
temp.im=b;
return temp;
};
complex plus_complex(complex a, complex b) // сложить два комплексных чисел
{ complex temp;
temp.re=a.re+b.re;
temp.im=a.im+b.im;
return temp;
}
int main() // простая тестовая программа
{
complex z;
printf( "vvedite re и im 1 chisla: ");
cin > > z.re > > z.im;
print( "z", z); printf("\n");
complex q;
printf( "vvedite re и im 2 chisla: ");
cin > > q.re > > q.im;
print("q", q); printf("\n");
complex sum;
sum=plus_complex(z,q);
print("q+z", sum); printf("\n");
return 0;
}
0
var a: array [1...n] of integer;
j, k, max: integer:
begin
for j:=1 to n do
readln(a[j]);
sum:=0
For j:=1 to n do
if a[j]mod=0 then sum:=sum*a[j]
Writeln(sum);
end.