标签:
1 for var a in 0...1000 2 { 3 var rep = 0 4 var aa = a 5 repeat{ 6 rep = rep * 10 + aa % 10 7 aa = aa / 10 8 }while(aa>0) 9 if(rep == a) 10 { 11 print("\(a)是回文数") 12 } 13 }
swift 计算100000以内的 回文数
原文地址:http://www.cnblogs.com/pengpengzhang/p/5647937.html