Skip to content

Instantly share code, notes, and snippets.

View langrenfengzi's full-sized avatar
🐶
alive

Lang langrenfengzi

🐶
alive
View GitHub Profile
@langrenfengzi
langrenfengzi / monthlyCost
Created May 25, 2015 12:12
How much did you spend on subway in a month in BeiJing
function monthlyCost(price){
var sum = 0;
var n = 23;
var d08,d05;
d08 = price * 0.8;
d05 = price * 0.5;
for(var i=0;i<n*2;i++){
sum += price;
if(sum>=100 && price > d08){