CodeWars可以学习的

http://www.codewars.com/kata/54ff3102c1bad923760001f3/solutions/csharp

判断给定的字符串有多少个a e i o u

using System;
using System.Linq; public static class Kata
{
public static int GetVowelCount(string str)
{
return str.Count(x => "aeiou".IndexOf(x) != -);
}
}
public static class Kata
{
public static int GetVowelCount(string str)
{
return str.Where(c => new [] {'a','e','i','o','u'}.Any(v => v == c)).Count();
}
}

http://www.codewars.com/kata/5506b230a11c0aeab3000c1f

using System;

public class Evaporator { 

  public static int evaporator(double content, double evap_per_day, double threshold) {
return (int)Math.Ceiling(Math.Log(threshold / 100.0) / Math.Log(1.0 - evap_per_day / 100.0));
}
}
上一篇:单片机模拟 1/2 Bias、1/4 Duty的 LCD 驱动使用方法


下一篇:asp.net(c#)中相对路径(虚拟路径)和物理磁盘路径的转换