Advertisement
a53

NumarareCifre

a53
May 13th, 2022
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int F[11]={0},n;
  7. long long c=0;
  8. cin>>n;
  9. for(int i=1;i<=n;i++)
  10. {
  11. int x,nc=0;
  12. cin>>x;
  13. if(x==0) nc=1;
  14. while(x>0)
  15. {
  16. nc++;
  17. x=x/10;
  18. }
  19. F[nc]++;
  20. }
  21. for(int i=1;i<=10;i++)
  22. c=c+1LL*F[i]*(F[i]-1)/2;
  23. cout<<c;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement