CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//created by komunre
#include <iostream>
#include <cstddef>
using namespace std;
int main()
{
int repeat = 0;
int repeat2 = 1;
while (repeat != repeat2){
size_t a[4] = {0, 0, 0, 0};
size_t money = 0;
size_t calculation = 0;
size_t candy = 0;
cout << "Enter amount robots" << endl;
cin >> a[0];
cout << "Enter perfomance" << endl;
cin >> a[1];
cout << "Enter endurance" << endl;
cin >> a[2];
cout << "Enter cost" << endl;
cin >> a[3];
cout << "Enter maximum cost you can afford" << endl;
cin >> money;
if (money >= a[3] * a[2])
{
calculation = money - (a[3] * a[2]);
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run