Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int reduce(int a, int b){
- int s = 0;
- while(a){
- if(a % 10 == 0)
- a = a / 10;
- if(b % (a % 10) != 0)
- s = s + a % 10;
- a = a / 10;
- }
- return s;
- }
- int main()
- {
- cout << reduce(2402804 , 8000);
- return 0;
- }
Add Comment
Please, Sign In to add comment