home *** CD-ROM | disk | FTP | other *** search
- // P⌐íklad: Programování v C++ na FJFI - ÇVUT
- #pragma hdrfile="TCDEF.SYM" // pro urychlení p⌐ekladu
- #include <iostream.h>
- #define swap(x,y) x=x+y;y=x-y;x=x-y;
-
- int main(){
- /* char t1='p';
- char t2='d';
- cout << "Vstup: " << t1 << " " << t2 << endl;
- swap(t1,t2);
- cout << "Vystup: " << t1 << " " << t2 << endl << endl;*/
- int a=5;
- int b=8;
- cout << "Vstup: " << a << " " << b << endl;
- swap(a,b);
- cout << "Vystup: " << a << " " << b << endl;
- return 0;
- }