Skip to content

Instantly share code, notes, and snippets.

@yswallow
Created April 25, 2012 09:59
Show Gist options
  • Save yswallow/2488629 to your computer and use it in GitHub Desktop.
Save yswallow/2488629 to your computer and use it in GitHub Desktop.
C言語とRubyのどちらでも動くHelloWorld
#include <stdio.h> /*
=begin
*/
//C言語の記述
int main(void)
{
printf("Hello,World!\n");
return 0;
}
/*
=end
# Rubyの記述
puts "Hello,World!"
#*/
@yswallow
Copy link
Author

.cで保存するとC言語のプログラムとしてコンパイルできるし,.rbで保存するとRubyのプログラムとして実行できます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment