,   CyberForum.ru

: ? - C++

 
Hiteg
   Hiteg
0 / 0 / 0
: 15.09.2012
: 8
18.09.2012, 00:05     : ? #1
... 72
.. .
!
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
#include<iostream>
#include<math.h>
#include<windows.h>
#include<cmath>
using namespace std;
 
char bufRus[256];
 
char* Rus(const char* text) {
      CharToOem(text, bufRus);
      return bufRus;
      }
      
      
 
int main ()
{
    cout << Rus("Ç*ä**èå 2. Îïðåäåëå*èå ïëîù*äè ï*ð*ëëåðîãð*ìì* ïî êîîðäè**ò*ì åãî âåðøè*") << endl;
    float x1,x2,x3,x4,y1,y2,y3,y4,a,b,c,d,S;
    cout << Rus("Ââåäèòå êîîðäè**òû 1 âåðøè*û:") << endl;
    cin >> x1 >> y1;
    cout << Rus("Ââåäèòå êîîðäè**òû 2 âåðøè*û:") << endl;
    cin >> x2 >> y2;
    cout << Rus("Ââåäèòå êîîðäè**òû 3 âåðøè*û:") << endl;
    cin >> x3 >> y3;
    cout << Rus("Ââåäèòå êîîðäè**òû 4 âåðøè*û:") << endl;
    cin >> x4 >> y4;
    a=sqrt(pow(x2-x1,2)+pow(y2-y1,2));
    b=sqrt(pow(x3-x2,2)+pow(y3-y2,2));
    c=sqrt(pow(x4-x3,2)+pow(y4-y3,2));
    d=sqrt(pow(x1-x4,2)+pow(y1-y4,2));
    cout << Rus("Ñòîðî*û 4-õ óãîëü*èê*: ") << a << " " << b << " " << c << " " << d << endl;
    if ((a==c)&&(b==d))
    {
    S=((x1-x3)*(y2-y3)-(y1-y3)*(x2-x3));
    cout << Rus("Ïëîù*äü ï*ð*ëëåëîãð*ìì*: ");
    (S<0)?cout<< -S << endl: cout << S << endl;}
else
cout << Rus("4-õ óãîëü*èê *å ï*ð*ëëåëîãð*ìì") << endl;
system ("pause");
 
cout << Rus("Ç*ä**èå 3. Îïðåäåëå*èå ïëîù*äè ïðÿìîóãîëü*èê ïî êîîðäè**ò*ì åãî âåðøè*") << endl;
 
float AC,BD;
AC=sqrt((pow((x3-x1),2))+(pow((y3-y1),2)));
BD=sqrt((pow((x4-x2),2))+(pow((y4-y2),2)));
cout << Rus("Äè*ãî**ëè 4-õ óãîëü*èê*: ") << AC << " " << BD << endl;
 
float I;
if (AC==BD)
{
 I=a*b;
 cout << Rus("Ïëîù*äü ïðÿìîóãîëü*èê*: ");
 cout << I << endl;
}
else
cout << Rus("Ïî ýòèì êîîðäè**ò*ì *åëüçÿ ïîñòðîèòü ïðÿìîóãîëü*èê") << endl;
system ("pause");
cout << Rus("Ç*ä**èå 4. Îïðåäåëå*èå ïëîù*äè ðîìá* ïî êîîðäè**ò*ì åãî âåðøè*") << endl;
float H;
if ((a==c)&&(b==d))
{
 H=0.5*(AC*BD);
 cout << Rus("ïëîù*äü ðîìá* ð*â** ") << H << endl;
}
else
cout << Rus("Ïî ç*ä**ûì êîîðäè**ò*ì *åëüçÿ ïîñòðîèòü ðîìá") << endl;
system ("pause");
cout << Rus("Ç*ä**èå 5. Îïðåäåëå*èå ïëîù*äè òð*ïåöèè ïî êîîðäè**ò*ì åãî âåðøè*") << endl;
float M;
// :)
If (
{
M=S*2
cout << Rus("Ïëîù*äü ðîìá* ð*â** ") << M << endl;
}
else
cout << Rus("Ïî ç*ä**ûì êîîðäè**ò*ì *åëüçÿ ïîñòðîèòü òð*ïåöèþ.") << endl;
system ("pause");
}
1 42
(
Similar
41792 / 34177 / 6122
: 12.04.2006
: 57,940
18.09.2012, 00:05     : ?
:

C++ , .
C++
4 . , , , C++
: C++
C++
C++
, C++
C++



:
.
Mr.X
 ++
   Mr.X
2802 / 1578 / 247
: 03.05.2010
: 3,666
18.09.2012, 08:41     : ? #2
.
Yandex
18.09.2012, 08:41     : ?

: 00:30. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
@Mail.ru