Created
April 25, 2012 09:59
-
-
Save yswallow/2488629 to your computer and use it in GitHub Desktop.
C言語とRubyのどちらでも動くHelloWorld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> /* | |
=begin | |
*/ | |
//C言語の記述 | |
int main(void) | |
{ | |
printf("Hello,World!\n"); | |
return 0; | |
} | |
/* | |
=end | |
# Rubyの記述 | |
puts "Hello,World!" | |
#*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.cで保存するとC言語のプログラムとしてコンパイルできるし,.rbで保存するとRubyのプログラムとして実行できます。