src/work/athos/xy/xy.cc
author alpar
Fri, 23 Jul 2004 17:13:23 +0000
changeset 737 2d867176d10e
parent 240 4a1d2e642552
child 921 818510fa3d99
permissions -rw-r--r--
Several changes in Kruskal alg.
- Input object interface was changed to an STL compatible one.
- template parameters of class KruskalPairVec has been simplified.
- (the most of) the names meet the naming conventions.
- a lot of (but still not enough) documentation has been added.
- class KruskalMapVec has been commented out.
     1 #include <xy.h>
     2 #include <iostream>
     3 #include <vector>
     4 using namespace std;
     5 using namespace hugo;
     6 
     7 
     8 int main()
     9 {
    10 
    11 	cout << "Kérek szépen egy egész számot!" << endl;
    12 	int s;
    13 	cin >> s;
    14 
    15 	cout << "Kerek sok sikvektort." << endl;
    16 
    17 	xy<int> osszeg;
    18 	xy<int> kul;
    19 	xy<int> z;
    20 
    21 	vector< xy<int> > v;
    22  
    23 	while(cin >> z) {
    24 		v.push_back(z);
    25 		osszeg += z;
    26 		kul -= z;
    27        		cout << "Az összeg aktualisan: " << osszeg << endl;
    28        		cout << "A különbség aktualisan: " << kul << endl;
    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;
    34 	  cout << v[i] << " " << s << " szorosa " << v[i]*s <<endl;
    35 	  cout << v[i] << " " << s << " edrésze " << v[i]/s <<endl;
    36 	}
    37 	if (v.size()>1){
    38 	  cout << "Az elsö kettö szorzata: " << v[0]*v[1] << endl;
    39 	}
    40 	
    41 	cout << "Eleg nehez volt." << endl;
    42 }