CodeWars可以学习的
2015-07-03 20:56
337 查看
http://www.codewars.com/kata/54ff3102c1bad923760001f3/solutions/csharp
判断给定的字符串有多少个a e i o u
http://www.codewars.com/kata/5506b230a11c0aeab3000c1f
判断给定的字符串有多少个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) != -1); } }
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)); } }
相关文章推荐
- java的main()方法:0
- 写出健壮的js代码
- ROS, OPENCV3.0, cv_bridge包组合
- 【动手写排序】希尔排序
- 同步工具类(一)
- Hibernate 继承映射
- 全选、反选、全不选
- Fragment 创建及替换
- 面向对象的三个基本特性(大话设计模式笔记)
- postgreSQL数据类型
- 【超级经典】程序员装B指南
- Ubuntu 15.04 或更新版 更新源/Ubuntu 15.04 Vivid Vervet更新源已可用
- Android异步加载图片与文字(二)
- 20150619_OC之NSFileManager文件管理器
- java中AWT和SWing的区别与联系
- 如果给我一个时间节点,我想去到我离开这个世界的那一天
- 排序 - 选择法
- 傅立叶变换第1讲
- 排序 - 选择法
- Pascal 三角形(算法)