seadoglee's blog

By seadoglee, history, 3 years ago, In English

Since the last task of april fools contest is quite simple (comparing to other tasks), so on top of just making the program executable, I will try to output Hello world, with the combination of different language.

Original task:
Pascal & C++

//\
begin write('Hello world')end.(*
#include<iostream>
int main(){std::cout<<"Hello world*){";}

Python & C++

#//\
print('Hello world')
#include<iostream>/*
'''*/
int main(){std::cout<<"Hello world";}
//'''

C & C++
just kidding

Java & C++

//\
public class Main{ public static void main(String[] args){System.out.println("Hello World");}}/*
#include<iostream>
int main(){std::cout<<"Hello world*///";}

Chinese & English:

屌你世界
Hello world


Thank you for reading this post april fools shitpost. I thought of writing code that is executable in c++, python and pascal, but have no idea to fix the comment problem.
Feel free to share your idea.

  • Vote: I like it
  • +7
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it +14 Vote: I do not like it

The Chinese one though...

»
3 years ago, # |
  Vote: I like it +14 Vote: I do not like it

How do I write a multi-line comment in Chinese?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +27 Vote: I do not like it

    My teacher usually use red ball pen to write multi-line comment in Chinese, and you can do so?

»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Just for the record, programs like these are called polyglots and are actually used in practice, mostly when you want to use several languages at once while only using a single file.