Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, uc=0, x, s=0;
- cin>>n;
- for(int i=1; i<=n; i++)
- {
- cin>>x;
- int x1=x, c=0;
- while(x1>0)
- {
- c++;
- x1=x1/10;
- }
- uc=x%10;
- while(c>0)
- {
- if(x%10==uc) x=x/10;
- c--;
- }
- s=s+x;
- }
- cout<<s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement