输出四位完全平方数

#include <stdio.h>
int main()
{
int n;
int square;
int a, b, c, d;

for(n=32; n<=99; n++)
{
    square = n * n;
    a = square / 1000;
    b = square / 100 % 10;
    c = square % 100 / 10;
    d = square % 10;

    if(a == b && c == d)
    {
        printf("%d\n", square);
    }
}

}

猜你喜欢

转载自blog.csdn.net/z2431435/article/details/83214863