高中时期

10 PRINT "HELLO WORLD"
20 END

大学新生

program Hello(input, output)
begin
writeln(\'Hello World\')
end.


高年级大学生

include

int main(void)
{
printf("Hello, world!\n");
return 0;
}

职业新手

#include
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;

for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}

职业老手

#include
#include
using namespace std;

class string
{
private:
int size;
char *ptr;

string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}

~string()
{
delete [] ptr;
}

friend ostream &operator

转载于酷壳CoolShell 无删改 仅以此纪念陈皓(左耳朵耗子)