22 lines
463 B
C++
22 lines
463 B
C++
#include <iostream>
|
|
#include <iomanip>
|
|
#include <math.h>
|
|
using namespace std;
|
|
|
|
int main() {
|
|
int people;
|
|
int numPizzas;
|
|
double cost;
|
|
|
|
/* Type your code here. */
|
|
//people eat two slices each
|
|
// Pizza has 12 slices
|
|
// costs 14.95 each
|
|
cost = 14.95;
|
|
cin >> people;
|
|
numPizzas = ceil((2 * people)/12.0);
|
|
|
|
cout << "Pizzas: " << numPizzas << endl;
|
|
cout << "Cost: $" << fixed << setprecision(2) << cost*numPizzas << endl;
|
|
}
|