#include <stdio.h>
#include <math.h>
int main()
{
char str[80];
sprintf(str, "Pi 的值 = %f", M_PI); //str is "Pi 的值 = %f"
puts(str);
return(0);
}
Pi 的值 = 3.141593
#include <stdio.h>
#include <math.h>
int main()
{
char str[80];
sprintf(str, "Pi 的值 = %f", M_PI); //str is "Pi 的值 = %f"
puts(str);
return(0);
}
Pi 的值 = 3.141593