1.输入12:15,采用string类型的字符串,
len=a.find(":");
a.substr(0,len);
stoi(a.substr(0,len));
2.如何用cout来输出小数点后两位
#include<iomanip>
cout<<fixed<<setprecision(2)<<你要输出的东西<<endl;
1.输入12:15,采用string类型的字符串,
len=a.find(":");
a.substr(0,len);
stoi(a.substr(0,len));
2.如何用cout来输出小数点后两位
#include<iomanip>
cout<<fixed<<setprecision(2)<<你要输出的东西<<endl;