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
package decimaltest; | |
import java.math.BigDecimal; | |
/** | |
* | |
* @author neojou | |
*/ | |
public class BigDecimalTest { |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package neo.example; | |
import java.util.Scanner; | |
/** |
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
import cmath | |
import math | |
import sys | |
def get_float(msg, allow_zero): | |
x = None | |
while x is None: | |
try: | |
x = float(input(msg)) |
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
import sys | |
Zero = [" *** ", | |
"* *", | |
"* *", | |
"* *", | |
"* *", | |
"* *", | |
" *** "] | |
One = [" * ", |
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
print("Type integers, each followed by Enter \n") | |
print(" ^D or ^E to finished \n") | |
total = 0 | |
count = 0 | |
while True: | |
try: |
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
// | |
// ViewController.swift | |
// GetLocation | |
// | |
// Created by neojou on 2014/11/23. | |
// Copyright (c) 2014年 neojou. All rights reserved. | |
// | |
import UIKit | |
import CoreLocation |
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
import Foundation | |
func input() -> String { | |
var keyboard = NSFileHandle.fileHandleWithStandardInput() | |
var inputData = keyboard.availableData | |
return NSString(data: inputData, encoding:NSUTF8StringEncoding) | |
} |
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
import CoreFoundation | |
func find_armstrong() -> Int[] | |
{ | |
var result : Int[]; | |
result = []; | |
let cubeNumList : Int[] = [ 0 , 1, 2*2*2, 3*3*3, 4*4*4, 5*5*5, 6*6*6, 7*7*7, 8*8*8, 9*9*9]; | |
let pNumList : Int[] = [ 0 , 100, 200, 300, 400, 500, 600, 700, 800, 900]; |
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
import Foundation | |
// | |
// e.g. | |
// x[] = {3,6,2,1,4,5,2} | |
// head : 首和 : 3, 9, 11, 12, 16, 21, 23 | |
// tail : 尾和 : 2, 7, 11, 12, 14, 20, 23 | |
// 相同, 11, 12, 23, 共三組 | |
func headtail(x : Int[]) -> Int |
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
import Foundation | |
// | |
// e.g. | |
// f[] = {1, 3, 5, 7, 9} | |
// g[] = {2, 6, 8} | |
// | f[] - g[] | 最小的一個 | |
// result = 1 | |
func mindist(f : Int[], g : Int[]) -> Int | |
{ |