RIZOQULOV ABDULAZIZ
DASTURLASH FANIDAN BAJARGAN MUSTAQIL ISHI
5-MUSTAQIL ISH: 19-VARIANT
19VARIANT
#include
#include
#include
#include
#include
using namespace std;
int main(){
srand(time(0));
complex comp1(6,8);
complex comp2(2,4);
complex comp3 = comp1/comp2;
cout << "comp1(" << comp1.real() << "," << comp1.imag() << ")";
cout << "\ncomp2(" << comp2.real() << "," << comp2.imag() << ")";
cout << "\ncomp1 / comp2 = comp3(" << comp3.real() << "," << comp3.imag() << ")";
valarray valarr(125);
for(int i = 0; i < 126; i++)
valarr[i] = rand()%10;
cout << "\nvalarray(125) ->";
for(size_t n = 0; n < valarr.size(); n++)
cout << " " << valarr[n];
valarray myslice = valarr[slice(0,25,5)];
cout << "\nslice(0,25,5) ->";
for(size_t n = 0; n < myslice.size(); n++)
cout << " " << myslice[n];
valarr[gslice(0,{2,5},{5,5})] = 25;
cout << "\nvalarray[gslice(0,{2,5},{5,5})] = 25 ->";
for(size_t n = 0; n < valarr.size(); n++)
cout << " " << valarr[n];
return 0;
}
Dostları ilə paylaş: |