1 #include<iostream> 2 #include<string> 3 #include<sstream> 4 #include<set> 5 6 using namespace std; 7 8 int main() 9 { 10 double sum=0.345666; 11 cout.precision(4); //四舍五入,四位有效数字 12 cout<<sum<<endl; 13 return 0; 14 }
时间: 2024-10-19 16:32:40
1 #include<iostream> 2 #include<string> 3 #include<sstream> 4 #include<set> 5 6 using namespace std; 7 8 int main() 9 { 10 double sum=0.345666; 11 cout.precision(4); //四舍五入,四位有效数字 12 cout<<sum<<endl; 13 return 0; 14 }