fork download
  1. // Almost Java
  2. // Well, not really
  3.  
  4. // Ignore the next several lines all the way until "class MyProg"
  5. #include <iostream>
  6. struct System_ {
  7. struct out_ {
  8. template <typename T> void println(T x) { std::cout << x << '\n'; }
  9. template <typename T> void print(T x) { std::cout << x; }
  10. } out;
  11. } System;
  12. #define public public:
  13. #define String int argc, char* argv
  14. #define args
  15. #define PRETENDIDONTEXIST prog; int main(int argc, char* argv[])\
  16. { prog.main(argc, argv); }
  17. // Okay, now you can stop ignoring lines
  18.  
  19. class MyProg
  20. {
  21. public static void main(String[] args) // Hee hee
  22. {
  23. System.out.println("Hey, this actually kinda works!");
  24. System.out.print("Kinda nifty, don't you think?");
  25. }
  26. }
  27.  
  28. PRETENDIDONTEXIST // Yes, you heard me
  29.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Hey, this actually kinda works!
Kinda nifty, don't you think?