python每次处理一个字符的三种方法 a_string = "abccdea" print 'the first' for c in a_string: print ord(c)+1 print "the second" result = [ord(c)+1 for c in a_string] print result print "the thrid" def do_something(c): return ord(c)+1 result
package com.zuoye.test;//打印出所有的 "水仙花数 ",所谓 "水仙花数 "是指一个三位数,//其各位数字立方和等于该数本身.//例如:153是一个 "水仙花数 ",//因为153=1的三次方+5的三次方+3的三次方.public class Shuixian { public static void main(String[] args) { int a; int b; int c; int sum1=0; int su