Find out the number of isomorphic numbers between 1 and N. A homogeneous number is a group of numbers: it appears to the right of the square number. For example: 5 is the number to the right of 25, 25 is 625 to the right, and 5 and 25 are isomorphic numbers.
Detailed Description:
Prototype:
Input parameters:
int n: Finds all isomorphic numbers between 1 and N
return value:
int: Number of isomorphic numbers between 1 and N
Full code:
#include "OJ.h"/* Function: Find out the number of isomorphism between 1 to n input: int N: Find the total number of isomorphism between 1 to N returns: the number of isomorphism between Int:1 to N */int searchsameconstructnum ( int n) {/ * implements the function here */ long int m; int k; int cnt=0; for (int i=1;i<=n;i++) { m=i*i; k=i; while (k) { if (k%10==m%10) { k=k/10; M=M/10; } else break ; } if (k==0) cnt++; } return CNT;}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Find the number of isomorphic numbers