24 lines
448 B
C++
24 lines
448 B
C++
|
#include <iostream>
|
||
|
#include <sstream>
|
||
|
#include <string>
|
||
|
using namespace std;
|
||
|
|
||
|
int main() {
|
||
|
string object1Info = "Pencil 5 4";
|
||
|
string object2Info = "Notepad 13 12";
|
||
|
string object3Info = "Headphones 23 26";
|
||
|
|
||
|
istringstream objectISS(object1Info);
|
||
|
|
||
|
string object;
|
||
|
int quantity;
|
||
|
int price;
|
||
|
|
||
|
objectISS >> object >> quantity >> price;
|
||
|
|
||
|
cout << object << " x" << quantity << endl;
|
||
|
cout << "Price: " << price;
|
||
|
|
||
|
return 0;
|
||
|
}
|