VB高手再来下

来源:百度知道 编辑:UC知道 时间:2024/06/07 07:00:58
输出三位正整数满足 他们是完全平方数,并有两位数字相同
例144=12*12
676=26*26

C代码,你自已转一下
include"stdio.h"
int main()
{

int temp=10;
int a1,a2,a3,Cumulative;
while(temp<32) //1000开方小于32
{
Cumulative=temp*temp; //定义一个平方数
a1=Cumulative/100;
a2=(Cumulative/10)\10;
a3=Cumulative-(Cumulative/10)*10; //求个位,十位,百位的数字
if (a1=a2&&a1=a3&&a2=a3)
{
printf(%d,Cumulative);
}
//如果只要有两个数相等就打印这个平方数.

temp++; //temp自增
return 0;
}

}