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
package vending | |
type VendingMachine struct { | |
haveMoney int | |
priceList map[string]int | |
} | |
func NewVendingMachine() *VendingMachine { | |
vendingMachine := new(VendingMachine) | |
m := make(map[string]int) |
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
package vending | |
import ( | |
"testing" | |
"github.com/stretchr/testify/assert" | |
) | |
func Test500円を入れる(t *testing.T) { | |
vendingMachine := NewVendingMachine() |
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 requests | |
import json | |
class Resas: | |
__ENDPOINT = "https://opendata.resas-portal.go.jp/" | |
__API_VER = "api/v1-rc.1/" | |
__address = "" | |
def __init__(self, api_key): |
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
/* | |
* 回答の条件によって別フィールドの表示/非表示を切り替えるサンプルプログラム | |
* Copyright (c) 2014 Cybozu | |
* | |
* Licensed under the MIT License | |
*/ | |
(function() { | |
"use strict"; | |
//レコードの追加、編集、詳細画面で適用する |
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 RPi.GPIO as GPIO | |
import time | |
import requests | |
import json | |
BUTTON = 7 | |
LED_B = 11 | |
LED_G = 13 | |
LED_Y = 15 | |
LED_R = 12 |
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
public class Register | |
{ | |
public int CustomerCount; | |
public List<string> CustomerGroups; | |
public bool IsStop; | |
public int Minus; | |
public Register(int minus) | |
{ | |
CustomerCount = 0; |
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
using System; | |
using System.Text.RegularExpressions; | |
namespace yhpg9 | |
{ | |
public class MyClass | |
{ | |
public MyClass () | |
{ | |
} |
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
a = 1 | |
while(! (500000 % (1000 - a) == 0)) { | |
a += 1 | |
} | |
b = 1000 * (a - 500) / (a - 1000) | |
c = Math.sqrt(a ** 2 + b ** 2).toInteger() | |
ans = a * b * c | |
println(ans) |
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
line = "73167176531330624919225119674426574742355349194934" + | |
"96983520312774506326239578318016984801869478851843" + | |
"85861560789112949495459501737958331952853208805511" + | |
"12540698747158523863050715693290963295227443043557" + | |
"66896648950445244523161731856403098711121722383113" + | |
"62229893423380308135336276614282806444486645238749" + | |
"30358907296290491560440772390713810515859307960866" + | |
"70172427121883998797908792274921901699720888093776" + | |
"65727333001053367881220235421809751254540594752243" + | |
"52584907711670556013604839586446706324415722155397" + |
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
primeList = [2] | |
intList = [] | |
for (int i : 3 .. 200000) { | |
if (i % 2 != 0) { | |
intList.push(i) | |
} | |
} | |
while(intList.size() != 0) { | |
primeList.push(intList.first()) | |
intList.removeAll{it % primeList.last() == 0} |
NewerOlder