[ create a new paste ] login | about

ajiyoshi

Name:
Email:
Site/Blog:
Location:
Default language:
Favorite languages:
About:

Saved pastes by ajiyoshi:

C++, pasted on Sep 24:
1
2
3
4
#include<iostream>

using std::cout;
using std::endl;
...
view (31 lines, 4 lines of output)
C++, pasted on Sep 24:
1
2
3
4
#include<iostream>

using std::cout;
using std::endl;
...
view (30 lines, 3 lines of output)
C++, pasted on Sep 24:
1
2
3
4
#include<iostream>

using std::cout;
using std::endl;
...
view (27 lines, 1 line of output)
C++, pasted on Apr 16:
1
2
3
4
5
#include<vector>
#include<list>
#include<string>
#include<iostream>
#include<numeric>        //accumulate
...
view (35 lines, 3 lines of output)
PHP, pasted on Apr 16:
1
2
3
4
<?php
echo array_reduce(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), create_function('$a,$b', 'return $a+$b;'));
echo array_reduce(array("a", "b", "c"), create_function('$a,$b', 'return $a.$b;'));
?>
view (4 lines, 1 line of output)
Perl, pasted on Apr 15:
1
2
3
4
#自分で書く必要はない
use List::Util qw/reduce/;
print reduce { $a + $b } (1 .. 10);
print reduce { $a . $b } ("a", "b", "c");
view (4 lines, 1 line of output)
Ruby, pasted on Apr 15:
1
2
3
#自分で書く必要はない
p (1..10).inject(0){|a, b| a + b}
p ["a", "b", "c"].inject(""){|a, b| a + b}
view (3 lines, 2 lines of output)
Python, pasted on Apr 15:
1
2
3
4
# -*- coding: utf-8 -*-
#自分で書く必要はない
print reduce(lambda x, y: x + y, range(1, 11))
print reduce(lambda x, y: x + y, ["a", "b", "c"])
view (4 lines, 2 lines of output)
C++, pasted on Apr 15:
1
2
3
4
5
#include<iostream>
#include<list>
#include<string>

using namespace std;
...
view (43 lines, 3 lines of output)
C++, pasted on Apr 15:
1
2
3
4
5
#include<iostream>
#include<list>
#include<string>

using namespace std;
...
view (40 lines, 3 lines of output)
C, pasted on Apr 6:
1
2
3
4
#ifndef HASH_H
#define HASH_H

#include<stdio.h>
...
view (443 lines, 75 lines of output)