import java.util.Random;
public class S13 {
public static void main(String[] args) {
Random rand = new Random();
for (int i = 0; i < 5000; i++) {
System.out.println(aaa (rand.nextInt(2,15)));
}
}
public static String aaa(int n) {
Random rand = new Random();
String A = "abcdefghijllmnopqrstuvwxyz";
StringBuilder B = new StringBuilder();
for (int i = 0; i < n;i++){
StringBuilder B2 = new StringBuilder();
int len= rand.nextInt(3,15);
for(int j = 0; j < len; j++){
B2.append(A.charAt(rand.nextInt(A.length())));
}
B2.append(" ");
String ts = B2.toString();
if(i == 0){
ts = ts.substring(0,1).toUpperCase().concat(ts.substring(1));
}else if (i==n-1){
ts = ts.substring(0,ts.length()-1)+"!.?".charAt(rand.nextInt(3));
}
B.append(ts);
}
return B.toString();
}
}
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/fb9c3f9ddc63b34856eb290fea87f092.png)