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 ParkingSystem{
  10. public:
  11. int arr[4];
  12. ParkingSystem(int big, int medium, int small){
  13. arr[1] = big;
  14. arr[2] = medium;
  15. arr[3] = small;
  16. }
  17. bool addCar(int carType){
  18. if(arr[carType]){
  19. arr[carType]--;
  20. return true;
  21. }
  22. return false;
  23. }
  24. }
  25. ;
  26. // cLay version 20201121-1
  27.  
  28. // --- original code ---
  29. // #define main dummy_main
  30. // {}
  31. // #undef main
  32. //
  33. // class ParkingSystem {
  34. // public:
  35. // int arr[4];
  36. // ParkingSystem(int big, int medium, int small) {
  37. // arr[1] = big;
  38. // arr[2] = medium;
  39. // arr[3] = small;
  40. // }
  41. //
  42. // bool addCar(int carType) {
  43. // if(arr[carType]) arr[carType]--, return true;
  44. // return false;
  45. // }
  46. // };
  47.  
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