simple sample


SUBMITTED BY: Guest

DATE: Nov. 29, 2014, 4:56 p.m.

FORMAT: C++

SIZE: 514 Bytes

HITS: 1281

  1. #include <iostream>
  2. using namespace std;
  3. int tab[1000000];
  4. int ilosccyfr(int n)
  5. {
  6. int il=0;
  7. while(n>0)
  8. {
  9. if(n%10==0) il++;
  10. n = n/10;
  11. }
  12. return il;
  13. }
  14. int main()
  15. {
  16. int x=0;
  17. while(cin>>tab[x])
  18. {
  19. x++;
  20. }
  21. int ilosc = tab[x-1];
  22. int n = 0;
  23. for(int i = 0; i < x-1; i++)
  24. {
  25. if(ilosccyfr(tab[i])==ilosc) n++;
  26. }
  27. cout<<n;
  28. return 0;
  29. }

comments powered by Disqus