,   CyberForum.ru

/ - C++

C++ TImage TScrollBox' http://www.cyberforum.ru/cpp-beginners/thread250378.html
. TScrollBox TImage. TScrollBox, , TScrollBox? 55 . Image1->Parent = ScrollBox1; .
C++ , . . ) S . ) min . ) 5 15. ) 16- . .... http://www.cyberforum.ru/cpp-beginners/thread250376.html
C++
. . . . .
UML C++
UML VS 2005?
C++ !!!!!!!! http://www.cyberforum.ru/cpp-beginners/thread250357.html
C++ , ++ ...... , . : , , . - : , , , . ...

kazak
   kazak
3029 / 2350 / 155
: 11.03.2009
: 5,401
01.03.2011, 14:05     /
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#include <iostream.h>
#include <conio.h>
#include <math.h>
class Complex
{
   private:
   double real; // Äåéñòâèòåëü**ÿ ÷*ñòü
   double image; // Ì*èì*ÿ ÷*ñòü
public:
   Complex() {}; // Êî*ñòðóêòîð ïî óìîë÷**èþ
   Complex(double r) { real = r; image = 0; } // Êî*ñòðóêòîð
   Complex(double r, double i) { real = r, image = i; } // Êî*ñòðóêòîð
   ~Complex() {} // Äåñòðóêòîð
   float sqrt_() // Êîðå*ü êîìïëåêñ*îãî ÷èñë*
   {
      return sqrt(real * real - image * image);
   }
   Complex operator+(const Complex &) const; // Ïåðåãðóçê* îïåð*òîð* ñëîæå*èÿ
   Complex operator-(const Complex &) const; // Ïåðåãðóçê* îïåð*òîð* âû÷èò**èÿ
   Complex operator*(const Complex &) const; // Ïåðåãðóçê* îïåð*òîð* óì*îæå*èÿ
   Complex operator/(const Complex &) const; // Ïåðåãðóçê* îïåð*òîð* äåëå*èÿ
   // Ïåðåãðóçê* ôó*êöèè-îïåð*òîð* << äëÿ âûâîä* êë*ññ* Complex
   friend ostream &operator<<(ostream &, const Complex &);
   // Ïåðåãðóçê* ôó*êöèè-îïåð*òîð* >> äëÿ ââîä* êë*ññ* Complex
   friend istream &operator>>(istream &, Complex &);
};
// Ïåðåãðóçê* +
Complex Complex::operator+(const Complex &fp1) const
{
   Complex sum;
   sum.real = real + fp1.real;
   sum.image = image + fp1.image;
   return sum;
}
// Ïåðåãðóçê* -
Complex Complex::operator-(const Complex &fp1) const
{
   Complex dif;
   dif.real = real - fp1.real;
   dif.image = image - fp1.image;
   return dif;
}
// Ïåðåãðóçê* *
Complex Complex::operator*(const Complex &fp1) const
{
   Complex prod;
   prod.real = real * fp1.real - image * fp1.image;
   prod.image = real * fp1.image + fp1.real * image;
   return prod;
}
// Ïåðåãðóçê* /
Complex Complex::operator/(const Complex &fp1) const
{
   Complex quot;
   double k;
   k = fp1.real * fp1.real + fp1.image * fp1.image;
   quot.real = (real * fp1.real + image * fp1.image) / k;
   quot.image = (fp1.real * image - real * fp1.image) / k;
   return quot;
}
// Ïåðåãðóçê* îïåð*òîð* <<
ostream &operator<< (ostream &fo, const Complex &fp)
{
   if (fp.image < 0) fo << fp.real << "+i(" << fp.image << ")\n";
   else fo << fp.real << "+i" << fp.image << "\n";
   return fo;
}
// Ïåðåãðóçê* îïåð*òîð* >>
istream &operator>>(istream &fi, Complex &fp)
{
   cout << "Ââåäèòå äåéñòâèòåëü*óþ ÷*ñòü: ";
   fi >> fp.real;
   cout << "Ââåäèòå ì*èìóþ ÷*ñòü: ";
   fi >> fp.image;
   return fi;
}
void main()
{
   clrscr();
   // Êîìïëåêñ*ûå ÷èñë*
   Complex c1, c2;
   // Ââîä êîìïëåêñ*ûõ ÷èñåë
   cin >> c1;
   cin >> c2;
   // Âûâîä êîìïëåêñ*ûõ ÷èñåë
   cout << "\nc1 = " << c1;
   cout << "c2 = " << c2 << '\n';
   cout << "Êîðå*ü c1: " << c1.sqrt_() << "\n\n";
   // Âûâîä ðåçóëüò*òîâ îïåð*öèé
   cout << "c1 + c2 = " << (c1 + c2);
   cout << "c1 - c2 = " << c1 - c2;
   cout << "c1 * c2 = " << (c1 * c2);
   cout << "c1 / c2 = " << (c1 / c2);
   getch();
}
Escapable
,
.
.
 
: 21:42. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
@Mail.ru