diff options
Diffstat (limited to 'ue5')
| -rw-r--r-- | ue5/mean_mark.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ue5/mean_mark.hpp b/ue5/mean_mark.hpp index a28b219..e07aedc 100644 --- a/ue5/mean_mark.hpp +++ b/ue5/mean_mark.hpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define MEAN_MARK_H | 2 | #define MEAN_MARK_H |
| 3 | 3 | ||
| 4 | #include <typeinfo> | 4 | #include <typeinfo> |
| 5 | #include <iostream> | ||
| 5 | 6 | ||
| 6 | #undef SOLVED_3 | 7 | #undef SOLVED_3 |
| 7 | #define SOLVED_3 | 8 | #define SOLVED_3 |
| @@ -29,9 +30,12 @@ namespace Ti | |||
| 29 | unsigned count = 0; | 30 | unsigned count = 0; |
| 30 | for(; first != last; ++first) | 31 | for(; first != last; ++first) |
| 31 | { | 32 | { |
| 32 | if (typeid(*(*first)) != typeid(Student)) | 33 | /*if (typeid(*(*first)) != typeid(Student)) |
| 34 | continue;*/ | ||
| 35 | Student *s = dynamic_cast<Student *>(&(*(*first))); | ||
| 36 | if (s == NULL) | ||
| 33 | continue; | 37 | continue; |
| 34 | result += (*first)->mark(); | 38 | result += s->mark(); |
| 35 | ++count; | 39 | ++count; |
| 36 | } | 40 | } |
| 37 | return (count == 0) ? 0 : result / count; | 41 | return (count == 0) ? 0 : result / count; |
