|
Guruh talabasi Omonboyev Jaloliddin 7- tajriba 1-topshiriq
|
tarix | 26.04.2022 | ölçüsü | 98,89 Kb. | | #56410 |
| 7-tajriba
911-21 guruh talabasi Omonboyev Jaloliddin
7- Tajriba
1-topshiriq
Complex sinfidan foydalanib, ikkita kompleks sonlarni ko’paytiring.
#include
#include
using namespace std;
int main( )
{
double x,y,a,b,n=0,m=0;
cout<<"C1 Birinchi kompleks sonni real va haqiqiy qismini kirting(a,b): "; cin>>x>>y;
cout<<"C2 Ikkinchi kompleks sonni real va haqiqiy qismini kirting(a,b): "; cin>>a>>b;
complex c1 (x,y),c2(a,b);
n=x*a-y*b; m=b*x+a*y;
complex c3 (n,m);
cout << "C1 ning (real,noma'lum) = ("<< real ( c1 )<< ","<
cout << "C2 ning (real,noma'lum) = ("<< real ( c2 )<< ","<
cout<<"Natija yani C3=C1*C2\n";
cout << "C3 ning (real,noma'lum) = ("<< real ( c3 )<< ","<
getchar();
}
2-topshiriq
Valarray sinfidan foydalanib valarray massiv elementlari sonini aniqlang.
#include
#include
#include
using namespace std;
int main ()
{
int n; cin>>n;
valarray foo (n);
for (int i=0; i
{
cin>>foo[i];
}
slice myslice=slice(1,2,3);
foo[myslice] *= valarray(10,4);
foo[slice (0,3,3)] = 99;
cout << "Size: "<
return 0;
}
Dostları ilə paylaş: |
|
|