Helloworld和程序员人生
Posted xgboost
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Helloworld和程序员人生相关的知识,希望对你有一定的参考价值。
高中时期
- 10 PRINT "HELLO WORLD"
- 20 END
大学新生
- program Hello(input, output)
- begin
- writeln(\\\'Hello World\\\')
- end.
高年级大学生
- #include <stdio.h>
- int main(void)
- {
- printf("Hello, world!\\\\n");
- return 0;
- }
- </stdio.h>
职业新手
- #include <stdio.h>
- void main(void)
- {
- char *message[] = {"Hello ", "World"};
- int i;
- for(i = 0; i < 2; ++i)
- printf("%s", message[i]);
- printf("\\\\n");
- }
- stdio.h>
职业老手
- #include <iostream>
- #include <string>
- 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 <<(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 << endl;
- return(0);
- }
- /string></iostream>
大师级
- [
- 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)
- ]
- cotype THello
- {
- interface IHello;
- interface IPersistFile;
- };
- };
- [
- python人生从此处开始!