fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int c;
  5.  
  6. printf("class Main {\n");
  7. printf(" static void main(String[] args) {\n");
  8. while ((c = getchar()) != EOF) {
  9. if (c == 'a') printf(" System.out.print(\"Hello\");\n");
  10. else if (c == 'b') printf(" System.out.print(\"World\");\n");
  11. }
  12. printf(" }\n}\n");
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 2252KB
stdin
abaa
stdout
class Main {
  static void main(String[] args) {
    System.out.print("Hello");
    System.out.print("World");
    System.out.print("Hello");
    System.out.print("Hello");
  }
}