多種程式語言的“hello world!”寫法
阿新 • • 發佈:2018-12-31
C#include <stdio.h>main(){printf ("Hello World!\n");}C++#include <iostream.h>main(){for(;;){cout << "Hello World! ";}}C#class HelloWorld{ static void Main () { System.Console.Write("Hello World!"); }}PHP<?phpecho "<html><head><title>Hello World Page</title> </head><body>Hello World!</body></html>"?>HTML<HTML><HEAD><TITLE>Hello, World Page!</TITLE></HEAD><BODY>Hello, World!</BODY></HTML>Javaclass HelloWorld { public static void main (String args[]) { for (;;) { System.out.print("Hello World "); } }}Perl print "Hello, World!\n" while (1);Pythonprint "Hello world!"Also an infinite loop:while True: print "Hello world!"Rubyfor i in 1..1 puts "Hello World!"end感謝hello,world page!