#include <stdio.h>
#include <math.h>
int main ()
{
int r;
double PI,s;
scanf("%d",&r);
PI = atan (1.0) * 4;
s = PI * r * r;
printf("%.7f",s);
return 0;
}
Here atan arctangent function arctan, tangent function tan (π / 4) = 1, so atan (1) = π / 4, pi = 4.0 * atan (1.0) = 3.14159 ......
Reference article from: https: //blog.csdn.net/u013866359/article/details/41287399