Advertisement
anhkiet2507

Bài 6 Tin

Apr 5th, 2019
34,565
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. // Bài 6: Tính giai thừa
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a,i;
  8.     long long gt;
  9.     cout << "Nhap vao a: ";
  10.     cin >> a;
  11.     gt = 1;
  12.     for (i = 1; i <= a; i++)
  13.     {
  14.         gt = gt*i;
  15.     }
  16.     cout << a << "! = " << gt << endl;
  17.     system("pause");
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement