@RobertFurr/

I/O project

C++

No description

fork
loading
Files
  • main.cpp

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.9482918554707098","path":"main.cpp","file":{"path":"main.cpp","content":{"asEncoding":{"base64":"I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluICgpCnsKICBzdHJpbmcgbXlzdHI7CiAgZmxvYXQgcHJpY2U9MDsKICBpbnQgcXVhbnRpdHk9MDsKCiAgY291dCA8PCAiRW50ZXIgcHJpY2U6ICI7CiAgZ2V0bGluZSAoY2luLG15c3RyKTsKICBzdHJpbmdzdHJlYW0obXlzdHIpID4+IHByaWNlOwogIGNvdXQgPDwgIkVudGVyIHF1YW50aXR5OiAiOwogIGdldGxpbmUgKGNpbixteXN0cik7CiAgc3RyaW5nc3RyZWFtKG15c3RyKSA+PiBxdWFudGl0eTsKICBjb3V0IDw8ICJUb3RhbCBwcmljZTogIiA8PCBwcmljZSpxdWFudGl0eSA8PCBlbmRsOwogIHJldHVybiAwOwp9"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <string>
#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;
}