代码:
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
int a,b,c;
for(a=1;a<=n;a++){
for(b=1;b<=n;b++){
for(c=1;c<=n;c++){
if(c*c==a*a+b*b)
printf("(%d, %d, %d)\n",a,b,c);
}
}
}
}
运行结果:
代码:
#include <stdio.h>
#include<math.h>
#define pi 3.1415926
int main()
{
double a,b,c,d,f;
scanf("%lf %lf %lf %lf %lf",&a,&b,&c,&d,&f);
double n,h;
d=d/60;
f=f/3600;
n=c+d+f;
n=n*pi/180.0;
h=b+a*tan(n);
printf("%.2lf\n",h);
}
运行结果: