一剑西来注:呵呵
这个没编程基础都看不懂
--------------------------------------------------------------------------------
中学阶段
10 PRINT "HELLO WORLD"
20 END
--------------------------------------------------------------------------------
大学一年级
program Hello(input, output)
begin
writeln(‘Hello World‘)
end.
--------------------------------------------------------------------------------
大学高年级
(defun hello
(print
(cons ‘Hello (list ‘World))))
--------------------------------------------------------------------------------
初级程序员
#include <stdio.h>
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("
");
}
--------------------------------------------------------------------------------
编程老鸟
#include <iostream.h>
#include <string.h>
class string
{
private:
int size;
char *ptr;
public:
string() : size(0), ptr(new char(‘ ‘)) {}
string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}
~string()
{
delete [] ptr;
}
friend ostream &operator <<(ostream &, const string &);
string &operator=(const char *);
};
ostream &operator<<(ostream &stream, const string &s)
{
return(stream << s.ptr);
}
string &string::operator=(const char *chrs)
{
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}
int main()
{
string str;
str = "Hello World";
cout << str << end
return(0);
}
--------------------------------------------------------------------------------
编程高手
[
uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
]
library LHello
{
// bring in the master library
importlib("actimp.tlb");
importlib("actexp.tlb");
// bring in my interfaces
#include "pshlo.idl"
[
uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
&nbs