hello world程序集锦(5)

适用于Python 2:

#!/usr/bin/env python
print "Hello, world!"
适用于Python 3:

#!/usr/bin/env python
print("Hello, world!")

REXX

say "Hello, world!"

Ruby

#!/usr/bin/ruby
puts "Hello, world!"

Sbyke Laborana

INIT min:1001
Om:"Hello, world!"

Scheme

(display "Hello, world!")
(newline)

sed

(需要至少一行输入)

sed -ne '1s/.*/Hello, world!/p'

Seed7

$ include "seed7_05.s7i";

 const proc: main is func
 begin
  writeln("Hello, world!");
 end func;

Smalltalk

Transcript show: 'Hello, world!'

Small Basic

TextWindow.WriteLine("Hello, world!")

SNOBOL

OUTPUT = "Hello, world!"
END

SQL

第一种

CREATE TABLE MESSAGE (TEXT CHAR(15));
INSERT INTO MESSAGE (TEXT) VALUES ('Hello, world!');
SELECT TEXT FROM MESSAGE;
DROP TABLE MESSAGE;
第二种

SELECT 'hello, world';
第三种

print 'hello,world!'

Tcl

#!/usr/local/bin/tcl
puts "Hello, world!"

TScript

? "Hello, world!"

Turing

put "Hello, world!"

UNIX-style shell

程序中的/bin/sh可改为您使用的shell

#!/bin/sh
echo 'Hello, world!'

bc

 #!/usr/bin/bc -q
print "Hello World"
quit

dc

#!/usr/bin/env dc [Hello World]p

GUI

Delphi

program HelloWorld;
uses
 Dialogs;
begin
 ShowMessage('Hello, World!');
end.

Nuva

<.
 System.Ui.ShowMessage('Nuva', 'Hello, world!', ['OK'])
.>

Visual Basic

MsgBox "Hello, world!"
或者

Print "Hello, world!"

Visual FoxPro

? "Hello, world!"

X11

用一个程序

xmessage 'Hello, world!'

使用Qt

#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[])
{
 QApplication app(argc, argv);
 QLabel label("Hello, world!");
 label.show();
 return app.exec();
}


      

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/1615.html