This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/DataStructure/Code/ex06/score.h
2022-01-03 16:09:11 +08:00

41 lines
No EOL
651 B
C++

class Score
{
private:
int time = 0;
int *_s;
int _size;
public:
Score(int i)
{
_size = i;
_s = new int[_size - 1];
for (int i = 0; i < _size; i++)
{
_s[i] = 0;
}
}
void finish(int t)
{
_s[t] = 3 - 1 - (time++);
}
bool isFinish(int i)
{
if (_s[i] > 0)
return true;
return false;
}
int score(int i)
{
return _s[i];
}
bool isallFinish()
{
for (int i = 0; i < _size; i++)
{
if (!isFinish(i))
return false;
}
return true;
}
};