A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: CP Book - Program 9.8 - Stikked
From Harmless Capybara, 5 Years ago, written in C.
This paste is a reply to CP Book - Program 9.8 from Nave Nobel - view diff
Embed
  1.  #include <stdio.h>    
  2.  #include <string.h>    
  3.  int main()    
  4.  {    
  5.      char s[1002], word[100];    
  6.      int i, j, length, is_word_started;    
  7.      gets(s);    
  8.      length = strlen(s);    
  9.      is_word_started = 0;    
  10.      for (i = 0, j = 0; i < length; i++) {    
  11.          if (s[i] >= 'a' && s[i] <= 'z') {    
  12.              if (is_word_started == 0) {    
  13.                  is_word_started = 1;    
  14.                  word[j] = 'A' + s[i] - 'a'; // first character is capital    
  15.                  j++;    
  16.              }    
  17.              else {    
  18.                  word[j] = s[i];    
  19.                  j++;    
  20.              }    
  21.          }    
  22.          else if (s[i] >= 'A' && s[i] <= 'Z') {    
  23.              if (is_word_started == 0) {    
  24.                  is_word_started = 1;    
  25.              }    
  26.              word[j] = s[i];    
  27.              j++;    
  28.          }    
  29.          else if (s[i] >= '0' && s[i] <= '9') {    
  30.              if (is_word_started == 0) {    
  31.                  is_word_started = 1;    
  32.              }    
  33.              word[j] = s[i];    
  34.              j++;    
  35.          }    
  36.          else {    
  37.              if (is_word_started == 1) {    
  38.                  is_word_started = 0;    
  39.                  word[j] = '\0';    
  40.                  printf("%s\n", word);    
  41.                  j = 0;    
  42.              }    
  43.          }    
  44.      }    
  45.      return 0;    
  46.  }