,  ,

- C++

> > >

 
C++ http://www.cyberforum.ru/cpp-beginners/thread1040495.html
. -? #include <iostream> #include "Cat.h" #include "Dog.h" using...
C++ , . http://www.cyberforum.ru/cpp-beginners/thread1040488.html
C++
#include <iostream> #include <stdlib.h> #include <time.h> #include <cmath> #include <math.h> using namespace std; void tselyi1(int **mas, int const n,int const m); void tselyi2(int **mas,...
C++ (
=) , , , ) , ) ...
C++ http://www.cyberforum.ru/cpp-beginners/thread1040467.html
, , !!
C++ ! : Uxx+Uyy=0, , : x (0, 10), y (0, 10);...

EdNaron
0 / 0 / 0
: 07.12.2013
: 18

- C++

13.12.2013, 22:06. 1053. 25
( )

, , , .. 0.
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
/*IV. Ðå*ëèçîâ*òü â âèäå ÊËÀÑÑÀ **áîð ïîäïðîãð*ìì äëÿ âûïîë*å*èÿ 
ñëåäóþùèõ îïåð*öèé **ä âåêòîð*ìè:
1) ñëîæå*èå;
2) âû÷èò**èå;
3) ñê*ëÿð*îå óì*îæå*èå âåêòîðîâ;
4) óì*îæå*èå âåêòîð* ** ÷èñëî;
5) äëè** âåêòîð*.
Âåêòîð ïðåäñò*âèòü ñëåäóþùèì òèïîì:
struct Vector {double X, Y;};
Èñïîëüçóÿ ýòîò êë*ññ, ðåøèòü ç*ä*÷è:
1. Ä** ì*ññèâ A - ì*ññèâ âåêòîðîâ. Îòñîðòèðîâ*òü åãî â ïîðÿäêå óáûâ**èÿ äëè* âåêòîðîâ.
2. Ñ ïîìîùüþ ä*ò÷èê* ñëó÷*é*ûõ ÷èñåë ñãå*åðèðîâ*òü 2N öåëûõ ÷èñåë. N ï*ð 
ýòèõ ÷èñåë ç*ä*þò N òî÷åê êîîðäè**ò*îé ïëîñêîñòè. Âûâåñòè *îìåð* òðîéêè òî÷åê,
 êîòîðûå ÿâëÿþòñÿ êîîðäè**ò*ìè âåðøè* òðåóãîëü*èê* ñ **èáîëüøèì óãëîì.
*/
#include <iostream>
#include <cmath>
using namespace std;
class Vectors 
{
      public:
   struct Vec {double x, y;};
   void Sum () //ñëîæå*èå
  { struct Sum {double x, y;};
   Sum.x=Vec_a.x + Vec_b.x;
   Sum.y=Vec_b.y + Vec_b.y;}
  // cout<<"Ñóìì* = "<< Sum; //ïðîâåðê*
  
   void Sub () //âû÷èò**èå
  { struct Sub {double x, y;};
   Sub.x=Vec_a.x - Vec_b.x;
   Sub.y=Vec_b.y - Vec_b.y;}
   
   void Scale () //ñê*ëÿð*îå óì*îæå*èå
   {struct Scale {double x, y;};
   Scale.x=Vec_a.x * Vec_b.x;
   Scale.y=Vec_b.y * Vec_b.y;}
   
   void Umnoj () //óì*îæå*èå âåêòîð* ** ÷èñëî t
   {struct Umnoj {double x, y;};
   Umnoj.x=Vec_a.x * t;
   Umnoj.x=Vec_a.y * t;}
   
   void Dlina () //**õîæä*èå äëè**û
   {double Dlina;
   Dlina=sqrt(pow(Vec_a.x,2)+ pow(Vec_a.y,2))}; //ïî ôîðìóëå = êîðå*ü(*^2+b^2)
  
  
  /*Ç*ä*÷* 1 - Ñîðòèðîâê* ïî óáûâ**èþ äëè*
  void Sort()
  for (int i=1; i<n; i++)
  {????????????????????????????
  */
  
  /*Ç*ä*÷* 2 - 
  */
}
int main()
{int n; 
    system("chcp 1251");
    cout<<"Ââåäèòå êîëè÷åñòâî ýëåìå*òîâ ì*ññèâ*";
    cin>>n;
    struct Vector Vec; //îïðåäåëå*èå ñòðóêòóð*îé ïåðåìå**îé
   // struct vector a = { 3, 5 }; //ïðèìåð âåêòîð* * (3,5)
    cout<<"Ââåäèòå êîîðäè**òó x="; cin>>Vec_a.x; //Ââîäèì ç**÷å*èå õ äëÿ âåêòîð* *
    cout<<endl;
    cout<<"Ââåäèòå êîîðäè**òó y="; cin>>Vec_a.y; //Ââîäèì ç**÷å*èå ó äëÿ âåêòîð* *
    cout << "Vec a  = " << Vec_a.x<<" "<<Vec_a.y //âûâîä âåêòîð* a â âèäå Vec a = 4 ; 2
    Cout<<endl;
    struct vector b = { 2, 3 };
    cout<<"Ââåäèòå êîîðäè**òó x="; cin>>Vec_b.x; //Ââîäèì ç**÷å*èå õ äëÿ âåêòîð* b
    cout<<endl;
    cout<<"Ââåäèòå êîîðäè**òó y="; cin>>Vec_b.y; //Ââîäèì ç**÷å*èå y äëÿ âåêòîð* b
    cout << "Vec b  = " << Vec_b.x<<" ; "<<Vec_b.y << endl; //âûâîä âåêòîð* b â âèäå Vec b = -2 ; 5
    system("PAUSE");
    return 0;
}
0
? .
 
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru