src/work/athos/xy/xy.cc
author athos
Fri, 19 Mar 2004 14:47:36 +0000
changeset 207 9910d5a5be7f
parent 201 b9158a014fe8
child 240 4a1d2e642552
permissions -rw-r--r--
M?g ?rtam bele 2 dolgot, meg a tesztelot is kibovitettem.
athos@201
     1
#include <xy.h>
athos@201
     2
#include <iostream>
athos@201
     3
using namespace std;
athos@207
     4
using namespace hugo;
athos@201
     5
int main()
athos@201
     6
{
athos@207
     7
athos@207
     8
	cout << "Még egy skalárt is kérek (szépen)!" << endl;
athos@207
     9
	int s;
athos@207
    10
	cin >> s;
athos@207
    11
athos@207
    12
	cout << "Kerek sok sikvektort." << endl;
athos@201
    13
athos@201
    14
	xy<int> osszeg;
athos@207
    15
	xy<int> kul;
athos@201
    16
	xy<int> z;
athos@201
    17
athos@201
    18
	vector< xy<int> > v;
athos@207
    19
 
athos@201
    20
	while(cin >> z) {
athos@201
    21
		v.push_back(z);
athos@201
    22
		osszeg += z;
athos@207
    23
		kul -= z;
athos@201
    24
       		cout << "Az összeg aktualisan: " << osszeg << endl;
athos@207
    25
       		cout << "A különbség aktualisan: " << kul << endl;
athos@201
    26
	}
athos@201
    27
athos@201
    28
	cout << "A kovetkezo szamokat szoroztam ossze:" << endl;
athos@201
    29
	for(unsigned int i=0; i<v.size(); ++i) {
athos@201
    30
	  cout << v[i] << ", A normanégyzete: " << v[i].normSquare() <<endl;
athos@207
    31
	  cout << v[i] << " " << s << " szorosa " << v[i]*s <<endl;
athos@207
    32
	  cout << v[i] << " " << s << " edrésze " << v[i]/s <<endl;
athos@201
    33
	}
athos@207
    34
	if (v.size()>1){
athos@207
    35
	  cout << "Az elsö kettö szorzata: " << v[0]*v[1] << endl;
athos@207
    36
	}
athos@207
    37
	
athos@201
    38
	cout << "Eleg nehez volt." << endl;
athos@201
    39
}