Академический Документы
Профессиональный Документы
Культура Документы
:
(aleksandar.dimovski@fon.edu.mk)
:
:
: -
C++
: C++
()
C++.
. .
40
40
10
51-60
60-70
70-80
80-90
10
90-100
10
. (www.fon.edu.mk)
B. Eckel, Thinking in C++, 2nd
Edition, 2000. (www.BruceEckel.com)
Teach Yourself C++ in 21 Days,
Second Edition.
?
-
()
(C).
(C++).
( ).
()
()
-
?
.
.
() .
?
, , ,
, ,
.
2
:
( )
( )
:
()
, .
, ,
, ,
, .
, ,
2 :
.
,
.
.
:
.
.
.
, .
.
, .
,
, ,
.
()
.
, ..
,
.
:
Sijalica
on()
off()
osvetli()
zatemni()
Sijalica lt;
lt.on();
Sijalica,
lt,
: ,
, , .
:
, .
,
.
(),
.
:
,
.
,
.
.
Krug
,
.
Forma
Kvadrat
.
.
.
C++
1980 Bjarne
Stroustrup Bell New
Jersey. C
.
C++ 1983
.
1985 1990 . 1997
ISO C++
.
/
C++
C.
cout (printf), cin (scanf), endl (\n)
cout << Vnesi nova vrednost: ;
cin >> vred;
cout << Novata vrednost e: << vred << endl;
<<
.
>>
.
/
cout cin
.
cin &
.
/
iostream
std
/ :
#include <iostream>
using namespace std;
int main() {
int i; char c; float f;
cout<< "Vnesi 2 broja i eden znak: ";
cin >> i >> f >> c;
cout<< "Vneseni bea: " << i << ", " ;
cout<< f << ", i " << c << endl;
return 0;
}
#include <iostream>
using namespace std;
void show( int= 1, float = 2.3, long = 4 );
int main() {
show(); // Site tri vrednosti se preddefinirani
show( 5 ); // Se obezbeduva 1-iot argument
show( 6, 7.8 ); // Se obezbeduva 1-iot i 2-iot argument
show( 9, 10.11, 12L ); // Se obezbeduvat site 3 argumenti
show( , 3.5, 7L); // Greska, ne moze da se ispusti samo 1-iot arg
}
void show( int prv, float vtor, long tret ) {
cout<< prv = " << prv<< ", vtor = " << vtor;
cout<< ", tret = " << tret;<< endl;
return;
}
.
, .
int funk(int n)
double funk(int n)
#include <iostream>
using namespace std;
void show(int val) {
cout<< "Integer: " << val<< endl;
}
void show(double val) {
cout<< "Double: " << val<< endl;
}
int main() {
show(12);
show(3.1415);
return 0;
}