Advertisement
cd62131

Character

Feb 9th, 2014
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4.  
  5. using namespace std;
  6. struct Chara {
  7.   string name;
  8.   int age;
  9.   int score;
  10. };
  11. int main() {
  12.   vector<Chara> d;
  13.   while (cin) {
  14.     Chara chara;
  15.     cout << "NAME AGE SCORE: ";
  16.     cin >> chara.name >> chara.age >> chara.score;
  17.     if (chara.name == "0") break;
  18.     d.push_back(chara);
  19.   }
  20.   for (const Chara& c : d)
  21.     cout << c.name << " " << c.age << " " << c.score << endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement