![]() |
#2
luoj752017-03-21 00:03
|
只有本站会员才能查看附件,请 登录
为什么会多出一行空行 运行结果不对
只有本站会员才能查看附件,请 登录
#if 1
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main ()
{
string mystr;
float price=0;
int quantity=0;
cout << "Enter quantity: ";
getline (cin,mystr);
stringstream(mystr) >> quantity;
cout << "Enter price: ";
getline (cin,mystr);
stringstream(mystr) >> price;
cout << "Total price: " << quantity*price << endl;
return 0;
}
#endif