1 #include <iostream> 2 #include <iomanip> 3 int main() 4 { 5 int n; 6 cin >> n; 7 double PI = 3.14159265358979; 8 cout << setprecision(n) << fixed << PI << endl; 9 return 0; 10 }
1 #include <stdio.h> 2 int main() 3 { 4 double PI = 3.14159265358979; 5 printf("%.4f\n",PI); 6 return 0; 7 }
1 //java 2 System.out.println(String.format("%.2f",num));
标签:11,main,2023.8,int,3.14159265358979,小数点,include,%.,PI From: https://www.cnblogs.com/muzhaodi/p/17623892.html