fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int kases;
  8. cin >> kases;
  9. int kase;
  10. for(kase = 1; kase <= kases; kase++) {
  11. int N;
  12. cin >> N;
  13. vector result;
  14. result.push_back(1);
  15. int temp, carry = 0;
  16. for(int i = 2; i <= N; i++) {
  17. for(int j = 0; j < result.size(); j++) {
  18. temp = carry + result[j] * i;
  19. carry = temp / 10;
  20. result[j] = temp % 10;
  21. }
  22. while(carry) {
  23. result.push_back(carry % 10);
  24. carry /= 10;
  25. }
  26. }
  27. for(int i = result.size() - 1; i >= 0; i--){
  28. cout << result[i];
  29. }
  30. cout << endl;
  31. }
  32. return 0;
  33. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:13:20: error: missing template arguments before ‘result’
             vector result;
                    ^
prog.cpp:13:20: error: expected ‘;’ before ‘result’
prog.cpp:14:13: error: ‘result’ was not declared in this scope
             result.push_back(1);
             ^
stdout
Standard output is empty