COIN-OR::LEMON - Graph Library

source: lemon-0.x/src/work/athos/xy/xy.cc @ 752:327c2f67a066

Last change on this file since 752:327c2f67a066 was 513:60afd11e6cb3, checked in by athos, 21 years ago

xy_test added: it was not entirely useless, I found a mistake in xy.h

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