author | beckerjc |
Wed, 28 Apr 2004 20:55:18 +0000 | |
changeset 462 | 0ab31578af67 |
parent 207 | 9910d5a5be7f |
child 513 | 60afd11e6cb3 |
permissions | -rw-r--r-- |
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@240 | 8 |
cout << "Kérek szépen egy egész számot!" << 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 |
} |