1. 1.
    -1
    // stringstreams
    4. include <iostream>
    5. include <string>
    6. 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
    ···
   tümünü göster