Вы находитесь на странице: 1из 12

1.

++
,
++
Linux.
1.1. ++
++ .
1.1. a, b.
c ? ? . a, b, c .
,
. c c= a2b2 ,

=arctg

,
a
b

= .
2

1. a, b ( a, b ).
2. c, .
3. c, .
. , ,
(//), .
,
, , .

.
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
double a,b,c,alf,bet,s;
cout<<"A=";
cin>>a;
cout<<"B=";
cin>>b;
s=a*b/2;
c=pow(a*a+b*b,0.5);
alf=atan(a/b);
bet=3.14159/2-alf;
cout<<"\n A="<<a<<"\t B="<<b<<"\t C="<<c<<"\n";
cout<<"\nS="<<s<<"\t alf="<<alf*180/3.14159;
cout<<"\t bet="<<bet*180/3.14159<<endl;
}

1.2. ++

++ .
1-2. ( , ),
iostream math.h.. iostream
cin cout1.
1 iostream.

pow atan
math.h. C++
.
3. , cin cout
( ), ,
cin std::cin, cout std::cout.
4. .
5. {.
6. a, b, c, alf, bet, s.
() , .
. ++ , PR_1,
pr_1, Pr_1 pR_1 - .
7. = cout.
8. a cin
9. B= cout.
10. b cin.
11.
s=ab/2. : +, -, *, /.
12.
. pow(x,y) ++ xy.
13-14.
=arctg

,
a
b

= .
2

15-17. .
, ++
.
180
.

++,
, ( )
.
++ .
main(). C
.
,
. C++
.


_ main(_)
{

}
_ f1(_)
{

_ f2(_)
{

}
...
_ fn(_)
{

_ - .
main,
.
int main()
{

++
( .exe).
, .
:

- ,
, ;

,
, .

.
, .
++ ,
++ .
++
.
1. 2,
,
( .h) - ,
.
, .
2. ,
(
o).
.
3.
( )
,
. .
.
.
Linux .
2 , ,
. , .

1.3. Linux
++ Ubuntu
.
1. gcc (g++).
2. Anjuta.
3. Kdevelop.
1.3.1.

g++,
g++-4.1, gcc, gcc-4.1. Synaptic
(. . 1.1).

1.1: Synaptic

, Gnome g++.
C++.
,
.
, ++,

g++ name.cpp
name.cpp
.
a.out. ,
,
g++ -o nameout name.cpp
name.cpp , nameout
.

C g++
gcc.
gcc (g++)
( make).
-c.

g++ -c name.cpp
g++ :
, ,
, ,
. ,
,
.

Geany, Ubuntu.
Geany . Geany
Synaptic. Geany . 1.2.

1.2: Geany


Geany.
1. C/C++ (
)
New (with Template)
++
. ,
(. . 1.3).
2. .

(F8). (
.o).

1.3: Geany C++


3.
(F9).
4.
(F5).
, Geany (
) ,
.
.
(. . 1.4).

1.4: C++ Geany

%f
, %e
.
(
) ,
. 1.5.

1.5:
1.3.2. Anjuta
Ubuntu 7.10 Anjuta
Synaptic , Anjuta ,
, .
Anjuta c

Project.
Anjuta .
1.6-1.10.

1.6:

1.7:

1.8:

1.9: (, ..)

1.10:

(. . 1.11). (.
. 1.12).

1.11:

1.12:
Anjuta
.
(F9).
(F11).

Execute Program (F3).
(. . 1.13).

1.13: