Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- long long a, b = 0;
- cin >> a;
- while (a > 0)
- {
- b += a % 10;
- a /= 10;//a = a / 10
- if(a!=0)
- b *= 10;
- }
- cout << b;
- return 0;
- //int a, b, c, count = 0;
- //
- //for ( a = 0; a <= 185 / 15; a++)
- // for ( b = 0; b <= 185 / 17; b++)
- // for ( c = 0; c <= 185 / 21; c++ )
- // if ( 15 * a + 17 * b + 21 * c == 185)
- // {
- // printf("15 * %2d + 17 * %2d + 21 * %2d == 185\n", a, b, c);
- // count++;
- // //cout << "15 * " << a << " + 17 * " << b << " + 21 * " << c << " = 185\
- // }
- //cout << count;
- //
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement