Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- using namespace std;
- int main()
- {
- //Арифметические операции с переменными
- int a, b, c, d, e;
- float middle= 0.0;
- cout.precision(5);
- cin >> a >> b >> c >> d >> e;
- cout << endl << a + b << endl;
- cout << b * d << endl;
- cout << e / d / a << endl;
- cout << float((a + b + c + d + e)) / 5 << endl;
- cout << e - d - c - b - a << endl;
- // для выполнения операции и получения дробного результата необходимо привести int к double
- // или мы могли написать не 'int a,b,c,d,e', a 'float a,b,c,d,e'
- // тогда не нужно было бы приводить к типу
- middle = float((a + b + c + d + e)) / 5;
- cout << "Sr arifm: " << middle << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement