Advertisement
huutho_96

function

Oct 30th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. //https://www.facebook.com/CungHocLapTrinhUIT
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int GT(int n)
  6. {
  7.     int s = 1;
  8.     for (int i = 1; i <= n; i++)
  9.         s *= i;
  10.     return s;
  11. }
  12.  
  13. void main()
  14. {
  15.     int a, b, c;
  16.     cin >> a >> b >> c;
  17.     cout << GT(a) + GT(b) + GT(c) << endl;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement