This file contains 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
#include <iostream> | |
#include <set> | |
using namespace std; | |
int main() { | |
typedef std::multiset<int> MySet; | |
MySet heightSet; | |
for(int i = 0; i < 10; ++i) |
This file contains 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
# 配列を作成 | |
n = list() | |
for var in range(0, 10): | |
# 標準入力から一行読み込み | |
# int にキャスト | |
n.append( int(raw_input()) ) | |
# 配列を降順ソート | |
n.sort(reverse = True) |
This file contains 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 | |
$hi = fopen('php://stdin', "r"); | |
$ho = fopen('php://stdout', "w"); | |
# 空の配列を作成 | |
$arr = array(); | |
# 標準入力からデータをセット | |
for($i = 0; $i < 10; $i++) | |
{ |
This file contains 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
-- テーブルの作成 | |
create table tbl(height integer); | |
-- テキストファイルからデータを読み込む | |
.import data.txt tbl | |
-- 'tbl' から 'height' フィールドで降順ソートして 3 行読み込む | |
select * from tbl order by height desc limit 3; |
This file contains 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
;; 標準入力から n 回受け取ってリストに追加 | |
(defun input (lst n) | |
(cond | |
((eq (length lst) n) | |
lst | |
) | |
(t | |
(input (append lst (list (read)) ) n ) | |
) | |
) |
This file contains 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
#include <iostream> | |
#include <list> | |
using namespace std; | |
//! 選択ソートテンプレート関数 | |
template <typename InIt, typename Pred> | |
void select_sort(InIt init, InIt last, Pred pred) | |
{ | |
for(InIt curr = init; curr != last; ++curr) |
This file contains 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 Foo extends View.OnClickListener { |
This file contains 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
/** | |
* タイル画像をキャンバス上に敷き詰める. | |
* @param canvas 描画用キャンバス. | |
* @param resource リソースオブジェクト. | |
* @param resourceId タイル画像のリソースID. | |
*/ | |
public static void fillByTile(@NonNull Canvas canvas, | |
@NonNull Resources resource, | |
@DrawableRes int resourceId) | |
{ |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.Office.Interop.Word; | |
using Word = Microsoft.Office.Interop.Word; | |
namespace WordSample | |
{ |
This file contains 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
/** A -> (B -> C) 型の関数オブジェクト */ | |
template <typename A, typename B, typename C> | |
struct CurryImpl { | |
// コンストラクタでオリジナルの関数をキャプチャ | |
CurryImpl(function<C(A, B)>& f) : mFunc(f) {} | |
/** B -> C 型の関数オブジェクトをリターンする */ | |
function< C(B) > operator () (A& a) { | |
return CurryImpl2(mFunc, a); |
OlderNewer