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.
The Chinese one though...
How do I write a multi-line comment in Chinese?
My teacher usually use red ball pen to write multi-line comment in Chinese, and you can do so?
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.