Advertisement
edutedu

vr 44 pr4

Sep 30th, 2020 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int frecv[9];
  6.  
  7. ifstream f("bac.in");
  8.  
  9. int main()
  10. {
  11. int x, i, n, c;
  12. f>>n;
  13. for(i=0; i<n; i++)
  14. {
  15. f>>x;
  16. while(x!=0)
  17. {
  18. c=x%10;
  19. frecv[c]++;
  20. x/=10;
  21. }
  22. }
  23. for(i=0; i<=9; i++)
  24. {
  25. if(frecv[i]!=0)
  26. cout<<i<<" ";
  27. }
  28. return 0;
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement