fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int lol(int n,int *p)
  5. {
  6.  
  7. int j = 0;
  8.  
  9. for (j = 1; j <= n; j++)
  10. {
  11. if ((n % 2 == 0) && (j % 2 == 0))
  12. {
  13. *p = p * j;
  14.  
  15. }
  16.  
  17. if ((n % 2 != 0) && (j % 2 != 0))
  18. {
  19. *p = p * j;
  20. }
  21. }
  22. return *p;
  23. }
  24.  
  25. int main()
  26.  
  27. {
  28. int n;
  29. cout << "N: " << " ";
  30. cin >> n;
  31. if (lol(2 * &n) > 127)
  32. {
  33. cout << "Sorry , but no." << endl;
  34. }
  35. else
  36. cout << "Everything is fine." << endl;
  37.  
  38. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int lol(int, int*)’:
prog.cpp:13:20: error: invalid operands of types ‘int*’ and ‘int’ to binary ‘operator*’
             *p = p * j;
                  ~~^~~
prog.cpp:19:20: error: invalid operands of types ‘int*’ and ‘int’ to binary ‘operator*’
             *p = p * j;
                  ~~^~~
prog.cpp: In function ‘int main()’:
prog.cpp:31:15: error: invalid operands of types ‘int’ and ‘int*’ to binary ‘operator*’
     if (lol(2 * &n) > 127)
             ~~^~~~
stdout
Standard output is empty