Skip to content

Instantly share code, notes, and snippets.

@jnovikov
Created February 16, 2018 21:13
Show Gist options
  • Save jnovikov/2dff0d4539714342ce2440c6cb30b3f3 to your computer and use it in GitHub Desktop.
Save jnovikov/2dff0d4539714342ce2440c6cb30b3f3 to your computer and use it in GitHub Desktop.
kek
#include <iostream>
#include <ctime>
#include <iomanip>
#include <cstring>
using namespace std;
class Student {
private:
char name[51];
char surname[51];
int hp;
public:
void start_game() {
cin >> name >> surname;
hp = 100;
}
bool is_alive() {
return hp > 0;
}
void show() {
cout << name << " " << surname << " ";
cout << setw(3) << setfill('0') << hp;
if (hp <= 0) cout << "000. Game over.";
}
};
int main() {
Student s;
s.start_game();
s.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment