fork download
  1. #include <iostream>
  2. using namespace std;
  3. int factorial(int num) {
  4. int kq;
  5. for (int i=1; i<= num;i++) {
  6. kq = num*i;
  7. }
  8. return kq;
  9.  
  10. }
  11. int main() {
  12. // your code goes here
  13. cout<<"kq:" <<factorial(4);
  14. return 0;
  15. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
kq:16