分类:
2005-12-21 14:33:45
1.C/C++
#include
#include
int main(int argc, char * argv[])
{
printf("Hello, World! ");
return 0;
}
2.bash
#!/bin/bash
echo Hello, World!
3.Perl
#!/usr/bin/perl
print "Hello, World! ";
3.Python
#!/usr/bin/python
print "Hello, world!";
4.Java
class Hello{
public static void main(String args[]) {
System.out.println("Hello world! ");
}
}
5.汇编...曾经会写 -_-b
6.MPI -- Hello, World!
#include
#include
int main( int argc, char *argv[])
{
int done = 0, n, myid, numprocs, i;
double mypi, pi, h, sum, x;
double startwtime = 0.0, endwtime;
int namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc,&argv);
MPI_Comm_size(MPI_COMM_WORLD,&numprocs);
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
MPI_Get_processor_name(processor_name,&namelen);
printf("Hello,world! Process %d on %s ",myid, processor_name);
if (myid == 0)
{
startwtime = MPI_Wtime();
}
if (myid == 0)
{
endwtime = MPI_Wtime();
printf("wall clock time = %f ",
endwtime-startwtime);
}
MPI_Finalize();
return 0;
}
7. php 添加于2010-12
echo "hello, world!\n";
chinaunix网友2008-05-31 19:16:55
;师姐,是我啊,呵呵,偷偷来看你的blog,顺便补上汇编版本的hello wordl! [BITS 16] [ORG 0x0100] JMP start msg DB 'hello world!',13,10,'$' start: MOV DX,msg MOV AH,9 INT 21H RET
chinaunix网友2008-05-31 19:16:55
;师姐,是我啊,呵呵,偷偷来看你的blog,顺便补上汇编版本的hello wordl! [BITS 16] [ORG 0x0100] JMP start msg DB 'hello world!',13,10,'$' start: MOV DX,msg MOV AH,9 INT 21H RET