#include <stdio.h> #include<math.h> int getNum(long num) { int count = 0; while(num) { num/=10; count++; } return count; } int mypow(int n) { int p=1; int i; for(i= 0;i< n;i++) { p *=10; } return p; } int main(void) { long num =0; scanf("%d",&num); long squre = num*num; int n = getNum(num); int weishu = squre-num; if(weishu%mypow(n)==0) { printf("yes !\n"); } else { printf("no !\n"); } return 0; }
自守数判断
最新推荐文章于 2023-02-14 11:41:01 发布