COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/athos/xy/xy.cc @ 207:9910d5a5be7f

Last change on this file since 207:9910d5a5be7f was 207:9910d5a5be7f, checked in by athos, 17 years ago

Még írtam bele 2 dolgot, meg a tesztelot is kibovitettem.

File size: 885 bytes
Line 
1#include <xy.h>
2#include <iostream>
3using namespace std;
4using namespace hugo;
5int main()
6{
7
8        cout << "Még egy skalárt is kérek (szépen)!" << endl;
9        int s;
10        cin >> s;
11
12        cout << "Kerek sok sikvektort." << endl;
13
14        xy<int> osszeg;
15        xy<int> kul;
16        xy<int> z;
17
18        vector< xy<int> > v;
19 
20        while(cin >> z) {
21                v.push_back(z);
22                osszeg += z;
23                kul -= z;
24                cout << "Az összeg aktualisan: " << osszeg << endl;
25                cout << "A különbség aktualisan: " << kul << endl;
26        }
27
28        cout << "A kovetkezo szamokat szoroztam ossze:" << endl;
29        for(unsigned int i=0; i<v.size(); ++i) {
30          cout << v[i] << ", A normanégyzete: " << v[i].normSquare() <<endl;
31          cout << v[i] << " " << s << " szorosa " << v[i]*s <<endl;
32          cout << v[i] << " " << s << " edrésze " << v[i]/s <<endl;
33        }
34        if (v.size()>1){
35          cout << "Az elsö kettö szorzata: " << v[0]*v[1] << endl;
36        }
37       
38        cout << "Eleg nehez volt." << endl;
39}
Note: See TracBrowser for help on using the repository browser.