1. 1.
    0
    你好...
    ···
  1. 2.
    0
    我來自火星,我想知道你
    ···
  2. 3.
    0
    // stringstreams
    1. include <iostream>
    2. include <string>
    3. include <sstream>
    using namespace std;

    int main ()
    {
    string mystr;
    float price=0;
    int quantity=0;

    cout << "Enter price: ";
    getline (cin, mystr);
    stringstream(mystr) >> price;
    cout << "Enter quantity: ";
    getline (cin, mystr);
    stringstream(mystr) >> quantity;
    cout << "Total price: " << price*quantity << endl;
    return 0;
    }
    Enter price: 22.25
    Enter quantity: 7
    Total price: 155.75
    ···