A. Generous Kefa time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One day Kefa found n baloons. For convenience, we denote color of i-th baloon as si — lowercase letter of the Latin alphabe
/** *判断字符类型 */ function CharMode(iN) { if (iN >= 48 && iN <= 57) //数字 return 1; if (iN >= 65 && iN <= 90) //大写字母 return 2; if (iN >= 97 && iN <= 122) //小写 return 4; else return 8; //特殊字符 } /** * 统计字符类型 */ function
在C#中,通常判断一个字符是否为大写字母,有些人可能会第一时间想到用正则表达式,那除了正则表达式,是否还有其他方式呢? 答案是肯定的,先一睹为快,具体代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Demo_GC { class Program { static void Main(
最近看到一个网站, 欧拉计划.挺好玩,都是一些算法题.这是本站:http://projecteuler.net/problems 这个是中文站:http://pe.spiritzhang.com/ 下面贴两个小脚本,低端玩具 1.找出一个数的所有因子: #encoding:utf-8 import math def yinzi(n): list_yinzi = [] if n <= 2: return list_yinzi for i in range(2, int(math.sqrt(n))