All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Recover a number (Posted on 2019-10-29) Difficulty: 2 of 5
A certain positive integer N is twice the product of its digits.

Find N.

See The Solution Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
You let i run to square root of n, if divided, add i and n / i. | Comment 4 of 6 |
#include <iostream> geometry dash #include <cmath> using namespace std; int main() { int n; int s = 0; cin >> n; for (int i = 1; i <= sqrt(n); i++) { if (n % i == 0) { int j = n/i; if (i == j) { s = s + i; } else { s = s + i + j; } } } cout << "s = " << (s - n); return 0; }
  Posted by Annika Muhr on 2020-03-24 07:17:02
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (15)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information