src/work/athos/xy/xy.cc
author athos
Fri, 25 Mar 2005 15:32:05 +0000
changeset 1262 61f989e3e525
parent 513 60afd11e6cb3
permissions -rw-r--r--
This was a bug, I guess
athos@201
     1
#include <xy.h>
athos@201
     2
#include <iostream>
athos@513
     3
#include <vector>
athos@201
     4
using namespace std;
alpar@921
     5
using namespace lemon;
athos@513
     6
athos@513
     7
athos@201
     8
int main()
athos@201
     9
{
athos@207
    10
athos@240
    11
	cout << "Kérek szépen egy egész számot!" << endl;
athos@207
    12
	int s;
athos@207
    13
	cin >> s;
athos@207
    14
athos@207
    15
	cout << "Kerek sok sikvektort." << endl;
athos@201
    16
athos@201
    17
	xy<int> osszeg;
athos@207
    18
	xy<int> kul;
athos@201
    19
	xy<int> z;
athos@201
    20
athos@201
    21
	vector< xy<int> > v;
athos@207
    22
 
athos@201
    23
	while(cin >> z) {
athos@201
    24
		v.push_back(z);
athos@201
    25
		osszeg += z;
athos@207
    26
		kul -= z;
athos@201
    27
       		cout << "Az összeg aktualisan: " << osszeg << endl;
athos@207
    28
       		cout << "A különbség aktualisan: " << kul << endl;
athos@201
    29
	}
athos@201
    30
athos@201
    31
	cout << "A kovetkezo szamokat szoroztam ossze:" << endl;
athos@201
    32
	for(unsigned int i=0; i<v.size(); ++i) {
athos@201
    33
	  cout << v[i] << ", A normanégyzete: " << v[i].normSquare() <<endl;
athos@207
    34
	  cout << v[i] << " " << s << " szorosa " << v[i]*s <<endl;
athos@207
    35
	  cout << v[i] << " " << s << " edrésze " << v[i]/s <<endl;
athos@201
    36
	}
athos@207
    37
	if (v.size()>1){
athos@207
    38
	  cout << "Az elsö kettö szorzata: " << v[0]*v[1] << endl;
athos@207
    39
	}
athos@207
    40
	
athos@201
    41
	cout << "Eleg nehez volt." << endl;
athos@201
    42
}