fork download
  1. #pragma GCC optimize ("Ofast")
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. #define main dummy_main
  5. int main(){
  6. return 0;
  7. }
  8. #undef main
  9. class Solution{
  10. public:
  11. int subtractProductAndSum(int n){
  12. int arr[10];
  13. int sz = 0;
  14. while(n){
  15. arr[sz++] = n % 10;
  16. n /= 10;
  17. }
  18. {
  19. int Q5VJL1cS;
  20. int e98WHCEY;
  21. if(sz==0){
  22. e98WHCEY = 0;
  23. }
  24. else{
  25. e98WHCEY = arr[0];
  26. for(Q5VJL1cS=(1);Q5VJL1cS<(sz);Q5VJL1cS++){
  27. e98WHCEY += arr[Q5VJL1cS];
  28. }
  29. }
  30. {
  31. int FmcKpFmN;
  32. int xr20shxY;
  33. if(sz==0){
  34. xr20shxY = 1;
  35. }
  36. else{
  37. xr20shxY = arr[0];
  38. for(FmcKpFmN=(1);FmcKpFmN<(sz);FmcKpFmN++){
  39. xr20shxY *= arr[FmcKpFmN];
  40. }
  41. }
  42. return xr20shxY-e98WHCEY;
  43. }
  44. }
  45. }
  46. }
  47. ;
  48. // cLay varsion 20191214-1
  49.  
  50. // --- original code ---
  51. // #define main dummy_main
  52. // {}
  53. // #undef main
  54. //
  55. // class Solution {
  56. // public:
  57. // int subtractProductAndSum(int n) {
  58. // int arr[10], sz = 0;
  59. // while(n) arr[sz++] = n % 10, n /= 10;
  60. // return mul(arr(sz)) - sum(arr(sz));
  61. // }
  62. // };
  63.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty