fork download
  1. #include <bits/stdc++.h>
  2. #define ull unsigned long long
  3. #define ll long long
  4. #define el endl
  5. #define nl '\n'
  6. using namespace std;
  7.  
  8. void input()
  9. {
  10. if (fopen("in.txt", "r"))
  11. {
  12. freopen("in.txt", "r", stdin);
  13. freopen("out.txt", "w", stdout);
  14. }
  15. }
  16.  
  17. int sum(int x, int y, int z)
  18. {
  19. int sum;
  20.  
  21. sum = x + y + z;
  22. return sum;
  23. }
  24. double avr(int x, int y, int z)
  25. {
  26. double av;
  27. av = x + y + z / 3.0;
  28. return av;
  29. }
  30.  
  31. int main()
  32. {
  33. input();
  34. int a, b, c;
  35. cin >> a >> b >> c;
  36.  
  37. cout << "the summation and the average in order: " << sum(a, b, c) << " : " << avr(a, b, c) << nl;
  38. return 0;
  39. }
  40. // 1
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
the summation and the average in order: -1715398561 : -1.71542e+09