/* If the positive integer n is the tail of its square number, then n is the guard number, also called the isomorphism number. For example: 6 is the tail of its square number 36, 76 is the tail of its square number 5776, 6 and 76 are the number of the guard. These are also: 6^=3625^2=62576^2=5776376^= 141376625^=390625 Programming Tips: 1. The traditional use of a count variable count, and then the loop body has been number/10,count count, the last count is the number of digits 2. Directly with the log function, the number of bits count= (int) log10 ( num) +13. With the sprintf and strlen functions, sprintf (str, "%d", num), Count=strlen (str), this direct length efficiency is certainly much lower, but directly with the library function does not need to implement, STR is also valuable if string processing is required */# include <stdio.h>int quar (int x, int n) {int sum = 1;for (int i = 0; i < n; i++) {sum = s Um * x;} return sum;} int main (void) {int i,n,num,pow,count;scanf ("%d", &n); GetChar (); Absorbs the carriage return character. for (i = 0; i < n; i++) {count = 0;scanf ("%d", &num); GetChar (); Absorbs the carriage return character. int temp = NUM;POW = num * num;printf ("%d", pow), while (temp) {temp = temp/10;count++;} if (Pow% (quar, count)) = = num) printf ("yes!\n"); elseprintf ("no!\n");} return 0;}
1183 number of guards