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

Home > Just Math
An Atypical Product Problem (Posted on 2007-01-03) Difficulty: 2 of 5
Determine all possible positive integers, two or more digits long, like ABC...XYZ, such that ABC...XY0Z is a multiple of it.

Note: digits may be repeated.

See The Solution Submitted by K Sengupta    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
C++ program | Comment 4 of 5 |

//If Brute-Force is the only approach, following C++

//program should help.

int i=10;    //starting with a positive non-zero two digit number
int lastdigit=i mod 10;   //last digit of number i
int divident= (i-lastdigit) * 10 + lastdigit;

//the bigger number (ABC...XY0Z)

while (true)
{
 if (lastdigit mod i == 0)
     cout<<i<<";"<<lastdigit<<"\n";

 i++;
 lastdigit=i mod 10;
 divident= (i-lastdigit) * 10 + lastdigit;
}


  Posted by elementofsurprize on 2007-01-04 05:29:44
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 (10)
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