| 发表于:2007-03-27 10:20:091楼 得分:0 |
using system; using system.collections; using system.collections.generic; using system.text; namespace consoleapplication4 { class program { static void main(string[] args) { arraylist al = new arraylist(); int a; int b; int c; for (a = 1; a < 5; a++) for (b = 1; b < 5; b++) for (c = 1; c < 5; c++) { string tmp = string.format( "{0} ",a*100+b*10+c); if(al.indexof(tmp) < 0) al.add(tmp); } foreach(string tmp in al) console.writeline(tmp); console.writeline( "总数:{0} ",al.count); console.read(); } } } | | |
|