Changeset 207:9910d5a5be7f in lemon-0.x for src/work/athos/xy/xy.cc
- Timestamp:
- 03/19/04 15:47:36 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@299
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/athos/xy/xy.cc
r201 r207 2 2 #include <iostream> 3 3 using namespace std; 4 using namespace hugo; 4 5 int main() 5 6 { 6 cout << "Kerek sok sikvektorokat." << endl; 7 8 cout << "Még egy skalárt is kérek (szépen)!" << endl; 9 int s; 10 cin >> s; 11 12 cout << "Kerek sok sikvektort." << endl; 7 13 8 14 xy<int> osszeg; 15 xy<int> kul; 9 16 xy<int> z; 10 17 11 18 vector< xy<int> > v; 12 19 13 20 while(cin >> z) { 14 21 v.push_back(z); 15 22 osszeg += z; 23 kul -= z; 16 24 cout << "Az összeg aktualisan: " << osszeg << endl; 25 cout << "A különbség aktualisan: " << kul << endl; 17 26 } 18 19 20 27 21 28 cout << "A kovetkezo szamokat szoroztam ossze:" << endl; 22 29 for(unsigned int i=0; i<v.size(); ++i) { 23 30 cout << v[i] << ", A normanégyzete: " << v[i].normSquare() <<endl; 31 cout << v[i] << " " << s << " szorosa " << v[i]*s <<endl; 32 cout << v[i] << " " << s << " edrésze " << v[i]/s <<endl; 24 33 } 34 if (v.size()>1){ 35 cout << "Az elsö kettö szorzata: " << v[0]*v[1] << endl; 36 } 37 25 38 cout << "Eleg nehez volt." << endl; 26 39 }
Note: See TracChangeset
for help on using the changeset viewer.