fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int TEN = 10;
  5.  
  6. int main() {
  7. int n, lastDigitN = 0;
  8. cin >> n;
  9. int copyN = n;
  10. while (n > 0) {
  11. int currentNo;
  12. cin >> currentNo;//cout << currentNo;
  13. if (currentNo % TEN == copyN || n == 0) {
  14. ++lastDigitN;
  15.  
  16. }
  17. --n;
  18. }
  19. cout << lastDigitN;
  20. return 0;
  21. }
Success #stdin #stdout 0s 5244KB
stdin
9
90 90 9 9 9 9 9 99 9
stdout
7