Guest User

Untitled

a guest
Jan 5th, 2011
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.72 KB | None | 0 0
  1. High School/Jr.High
  2.  
  3.         10 PRINT "HELLO WORLD"
  4.         20 END
  5.  
  6. First year in College
  7.  
  8.          program Hello(input, output)
  9.           begin
  10.              writeln('Hello World')
  11.           end.
  12.  
  13. Senior year in College
  14.  
  15.          (defun hello
  16.           (print
  17.            (cons 'Hello (list 'World))))
  18.  
  19. New professional
  20.  
  21.          #include
  22.         void main(void)
  23.          {
  24.           char *message[] = {"Hello ", "World"};
  25.            int i;
  26.  
  27.            for(i = 0; i < 2; ++i)
  28.              printf("&#37;s", message[i]);
  29.            printf("\n");
  30.         }
  31.  
  32. Seasoned professional
  33.  
  34.         #include
  35.         #include
  36.          class string
  37.         {
  38.          private:
  39.           int size;
  40.            char *ptr;
  41.          public:
  42.            string() : size(0), ptr(new char('\0')) {}
  43.            string(const string &s) : size(s.size)
  44.           {
  45.            ptr = new char[size + 1];
  46.            strcpy(ptr, s.ptr);
  47.            }
  48.            ~string()
  49.           {
  50.            delete [] ptr;
  51.            }
  52.            friend ostream &operator <<(ostream &, const string &);
  53.            string &operator=(const char *);
  54.           };
  55.          ostream &operator<<(ostream &stream, const string &s)
  56.          {
  57.            return(stream << s.ptr);
  58.          }
  59.          string &string::operator=(const char *chrs)
  60.          {
  61.           if (this != &chrs)
  62.            {
  63.             delete [] ptr;
  64.           size = strlen(chrs);
  65.           ptr = new char[size + 1];
  66.              strcpy(ptr, chrs);
  67.           }
  68.            return(*this);
  69.         }
  70.          int main()
  71.          {
  72.            string str;
  73.            str = "Hello World";
  74.            cout << str << endl;
  75.            return(0);
  76.          }
  77.  
  78. Apprentice Hacker
  79.  
  80.  #!/usr/local/bin/perl
  81.  $msg="Hello, world.\n";
  82.  if ($#ARGV >= 0) {
  83.    while(defined($arg=shift(@ARGV))) {
  84.      $outfilename = $arg;
  85.      open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";
  86.      print (FILE $msg);
  87.      close(FILE) || die "Can't close $arg: $!\n";
  88.    }
  89.  } else {
  90.    print ($msg);
  91.  }
  92.  1;
  93.  
  94. Experienced Hacker
  95.  
  96.  #include
  97.  #define S "Hello, World\n"
  98.  main(){exit(printf(S)  strlen(S) ? 0 : 1);}
  99.  
  100. Seasoned Hacker
  101.  
  102.  % cc -o a.out ~/src/misc/hw/hw.c
  103.  % a.out
  104.  
  105. Guru Hacker
  106.  
  107.  % cat
  108.  Hello, world.
  109.  ^D
  110.  
  111. New Manager
  112.  
  113.  10 PRINT "HELLO WORLD"
  114.  20 END
  115.  
  116. Middle Manager
  117.  
  118.  mail -s "Hello, world." bob@b12
  119.  Bob, could you please write me a program that prints "Hello, world."?
  120.  I need it by tomorrow.
  121.  ^D
  122.  
  123. Senior Manager
  124.  
  125.  % zmail jim
  126.  I need a "Hello, world." program by this afternoon.
  127.  
  128. Chief Executive
  129.  
  130.  % letter
  131.  letter: Command not found.
  132.  % mail
  133.  To: ^X ^F ^C
  134.  % help mail
  135.  help: Command not found.
  136.  % damn!
  137.  !: Event unrecognized
  138.  % logout
Add Comment
Please, Sign In to add comment