程式碼如下:
1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 int main() 5 { 6 double a; 7 cin>>a; 8 double b=round(a*100); 9 cout<<b<<"%"<<endl; 10 return 0; 11 }
程式碼如下:
1 #include <iostream> 2 #include <cmath> 3 using namespace std; 4 int main() 5 { 6 double a; 7 cin>>a; 8 double b=round(a*100); 9 cout<<b<<"%"<<endl; 10 return 0; 11 }