Guruh Ileshev Asadbek Alisher o’g’li
Download 156.94 Kb.
|
Ileshev Asadbek
610-22-guruh Ileshev Asadbek Alisher o’g’li 2-amaliy mashg’ulot. 6-variant. 1-topshiriq. #include class Complex { private: double real, imag; public: Complex(double r = 0.0, double i = 0.0) : real(r), imag(i) {} void print() { std::cout << real << " + " << imag << "i" << std::endl; } Complex operator--() { real--; imag--; return Complex(real, imag); } Complex operator--(int) { Complex temp(real, imag); real--; imag--; return temp; } }; int main() { Complex a(3.0, 4.0); Complex b = --a; Complex c = a--; a.print(); b.print(); c.print(); return 0; } 2-topshiriq. #include #include using namespace std; int main(){ valarray cout<<"Massiv elementlari: "; for(int i=0; i<=96; i++){ a[i]=i; cout<} cout< cout << "slice(0,17,6): \n"; cout<<"Har 6-qadam elementlari : "; for (size_t n=0; n cout << '\n'; return 0; } Download 156.94 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling