Git Product home page Git Product logo

contestframework's Introduction

Contest Framework

##Why? It has an extra power to make your codes shorter and with no wrong. For example look at this simple code that read judge system's input line by line and prints each number that is prime:

<?PHP
Class q2 extends \contest\contest {
  Public function index () {
      ReadByLine ($this->input, function ($line) {
         Offprint (is_prime ($line), $line, false);
      });
  }
}
?>

And are you ready to write it by yourself,but without this framework?

<?php
Function is_prime ($a) {
  If ($a == 1) return false;
  If ($a == 2) return true;
  If ($a % 2 == 0) return false;
  $Lim = (int) sqrt ($a);
  For ($i = 2; $i <= $lim; $i++) {
  	If ($a % $i == 0) {
  		Return false;
  	}
  }
  Return true;
}
While (fscanf (STDIN, '%d', $number1) === 1) {
  If (is_prime ((int) $number1)) {
  	fprintf(STDOUT,"%d\n",$number1);
  }
}

##Who? All of PHP programmers that want to participate in programming contests ##What? A PHP framework to help you to participate in programming contests.

contestframework's People

Contributors

qti3e avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.