This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
println!("{}", (0_u128..).into_iter().fold(0, |a, b| a + b)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gcd(a, b): | |
if b == 0: | |
return a | |
return gcd(b, a % b) | |
def main(): | |
print("input three integers:") | |
a = int(input()) | |
b = int(input()) | |
c = int(input()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lines configured by zsh-newuser-install | |
HISTFILE=~/.histfile | |
HISTSIZE=1000 | |
SAVEHIST=1000 | |
bindkey -e | |
# End of lines configured by zsh-newuser-install | |
# The following lines were added by compinstall | |
zstyle :compinstall filename '/Users/saitoumotoki/.zshrc' | |
autoload -Uz compinit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prev_main = """ | |
#include <iostream> | |
#include <list> | |
#include <iterator> | |
using namespace std; | |
list<char> a; | |
list<char>::iterator itr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Peano | |
def self.method_num | |
instance_methods(false) | |
.map{ |a| a.to_s} | |
.filter{ |a| /\Anum\d+\Z/ =~ a } | |
.size | |
end | |
def self.increment | |
num = self.method_num + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WIDTH = 1000; | |
const HEIGHT = 700; | |
let bullets = []; | |
for(let i = 0; i < 100; ++i){ | |
const mergin = 10; | |
let x = Math.random() * (WIDTH - mergin * 2) + mergin; | |
let y = Math.random() * (HEIGHT - mergin * 2) + mergin; | |
bullets.push({x: x, y: y}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const LPAREN = /^\s*\(/; | |
const RPAREN = /^\s*\)/; | |
const SPACES = /^\s+/; | |
const PLUS = /^\s*\+/; | |
const MINUS = /^\s*\-/; | |
const MULTI = /^\s*\*/; | |
const DEVIDE = /^\s*\//; | |
const NUMBER = /^\s*\d+(\.\d+)?/; | |
const END = /^\s*$/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.InputStream; | |
import java.io.IOException; | |
class MyScanner{ | |
InputStream stream; | |
public MyScanner(){ | |
stream = System.in; | |
} | |
public int nextInt(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash a.bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Your code here! | |
const STDIN = fopen('php://stdin', 'r'); | |
class LinkedList { | |
public $next, $prev, $value; | |
public function __construct(){ | |
$this->next = null; | |
$this->prev = null; |