diff options
Diffstat (limited to 'week05/Exercise1.cpp')
| -rw-r--r-- | week05/Exercise1.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/week05/Exercise1.cpp b/week05/Exercise1.cpp index 28fc290..7fdaa7d 100644 --- a/week05/Exercise1.cpp +++ b/week05/Exercise1.cpp @@ -24,9 +24,10 @@ public: patients[lastIndex++] = newPatient; } - // По принцип логиката трябва да е по-сложна, да се маха пациент по индекс и - // след това да се изместват останалите, но за целите на задачата това не е нужно - void RemovePatient() { + void RemovePatient(int index) { + for (int i = index; i < lastIndex - 1; i++) { + patients[i] = patients[i+1]; + } lastIndex--; } }; |
