1.循环遍历a,b;
2.找出a*a+b*b的平方根为整数的情况;
3.输出a,b,c
#include<iostream>
#include<cmath>
using namespace std;
int main(){
for(int a=1;a<=100;a++){
for(int b=1;b<=100;b++){
double c=sqrt(a*a+b*b);
if(c==(int)c&&c<=100){
printf("a=%-2d b=%-2d c=%.0f\n",a,b,c);
}
}
}
return 0;
}
标签:%-,int,29,2d,股数,include,day From: https://www.cnblogs.com/drz1145141919810/p/17405493.html