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 29 30 31 32 33 34
|
#include <iostream>
using namespace std;
int calc(int x, int y, int z, int a, short amount_touchdown, short touchdown, short amount_field_goal, short field_goal, short amount_extra_point, short extra_point, short amount_safety, short safety)
{
return((amount_touchdown*touchdown=x) (amount_field_goal*field_goal=y) (amount_extra_point*extra_point=z)(amount_safety*safety=a)x+y+z+a);
}
int main()
{
int x;
int y;
int z;
int a;
short touchdown=6;
short amount_touchdown;
short field_goal=3;
short amount_field_goal;
short extra_point=1;
short amount_extra_point;
short safety=2;
short amount_safety;
cout << "enter amount of touchdowns \n" << endl;
cin >> amount_touchdown;
cout << "enter amount of field_goals \n" << endl;
cin >> amount_field_goal;
cout << "enter amount of extra points \n" << endl;
cin >> amount_extra_point;
cout << "enter amount of safety" << endl;
cin >> amount_safety;
cout << calc(touchdown, field_goal, extra_point, safety, amount_extra_point, amount_field_goal, amount_safety, amount_touchdown, x, y, z, a) << endl;
return 0;
}
|