{
for (int i = 1i <= 50++i)
{
cout <<i
if (i % n == 0)
cout <<endl
else
cout <<", "
}
}
import java.util.ArrayListimport java.util.List
public class="superseo">class test {
public static void main(String args[])
{
List<String>listAAB = new ArrayList<String>()
List<String>listABC = new ArrayList<String>()
List<String>listNoAAB = new ArrayList<String>()
List<String>listNoABC = new ArrayList<String>()
for(int i=0i<1000i++){
String s = ""+i
while(s.length()<3)
{
s = "0"+s
}
char c1 = s.charAt(0)
char c2 = s.charAt(1)
char c3 = s.charAt(2)
if(c1==c2&&c1!=c3){
listAAB.add(s)
}else{
listNoAAB.add(s)
}
if(c1!=c2&&c1!=c3&&c2!=c3){
listABC.add(s)
}else{
listNoABC.add(s)
}
}
System.out.println("AAB"+listAAB)
System.out.println("ABC"+listABC)
System.out.println("NoAAB"+listNoAAB)
System.out.println("NoABC"+listNoABC)
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)