import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class sort {
public static void main(String[] args) {
System.out.println("=====请输入连接=====");
Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
String reg = "(https?|HTTPS?)://[-A-Za-z0-
9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]";
Pattern pattern = Pattern.compile(reg);
Matcher matcher = pattern.matcher(line);
String url = "";
if(matcher.find()) {
url = matcher.group();
}
//String prefix = url.substring(0,
url.lastIndexOf("?") + 3).toLowerCase();
String prefix1 = url.substring(0,
url.lastIndexOf("?") + 3);
String prefix2 = url.substring(prefix1.length(),
prefix1.length() + 1).toUpperCase();
String prefix =prefix1.toLowerCase() + prefix2;
String suffix = url.substring(url.lastIndexOf
("?") + 4, url.length());
String reg1 = "([0-9])";
Pattern pattern1 = Pattern.compile(reg1);
Matcher matcher1 = pattern1.matcher(suffix);
if(matcher1.find()){
System.out.println(prefix
+suffix.toLowerCase());
}
char array [] = suffix.toCharArray();
//标识字符串的某个位置是字母还是非字母
boolean flag [] = new boolean [array.length];
int n = 1; //字符串大小写组合的总数
int count = 0; //统计给定的字符串中包含的字母
个数
for (int i = 0; i < array.length; i++) {
if (Character.isLetter(array[i])) {
flag[i] = true; //是字母
n *= 2; //每出现一个字母,组合
的总数乘以2
count++;
} else {
flag[i] = false; //非字母
}
}
try {
int num = 0;
//BufferedOutputStream out = new
BufferedOutputStream(new FileOutputStream("D://link.txt"));
//打印出每一种字符串组合
for (int i = 0; i < n; i++) {
//将0~n-1转化为二进制数字
String temp =
Integer.toBinaryString(i);
StringBuilder sb = new
StringBuilder();
for (int j = 0; j < count -
temp.length(); j++) {
//追加‘0’,将0变为0000
的形式
sb.append("0");
}
sb.append(temp);
String str = "";
char tempArray [] = sb.toString
().toCharArray();
int k = 0;
for (int j = 0; j < flag.length;
j++) {
char val = array[j]; //
先取出该位置上的字符
if (flag[j]) { //该位置
上是字母
if ('0' ==
tempArray[k]) { //小写
//System.out.print(Character.toLowerCase(val));
str +=
Character.toLowerCase(val);
} else { //大写
//System.out.print(Character.toUpperCase(val));
str +=
Character.toUpperCase(val);
}
k++;
} else { //该位置上非字
母
//System.out.print(val);
str += val;
}
}
//str += "\n";
str = prefix + str;
//byte[] b = str.getBytes();
//out.write(b, 0, b.length);
reg = "([E|e|o|H|Q|Q|
Xhttps://wap.ha.10086.cn/business/work-order-repair.action?
EKYEOhQqx])";
pattern = Pattern.compile(reg);
matcher = pattern.matcher(str);
if(matcher.find()) {
num ++;
System.out.println(str);
if(num % 8 == 0) {
System.out.println("");
}
}
}
//刷新缓冲
//out.flush();
//out.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
scanner.close();
}
}
//好了
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class sort {
public static void main(String[] args) {
System.out.println("=====请输入连接=====");
Scanner scanner = new Scanner(System.in);
String line = scanner.nextLine();
String reg = "(https?|HTTPS?)://[-A-Za-z0-
9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]";
Pattern pattern = Pattern.compile(reg);
Matcher matcher = pattern.matcher(line);
String url = "";
if(matcher.find()) {
url = matcher.group();
}
//String prefix = url.substring(0,
url.lastIndexOf("?") + 3).toLowerCase();
String prefix1 = url.substring(0,
url.lastIndexOf("?") + 3);
String prefix2 = url.substring(prefix1.length(),
prefix1.length() + 1).toUpperCase();
String prefix =prefix1.toLowerCase() + prefix2;
String suffix = url.substring(url.lastIndexOf
("?") + 4, url.length());
String reg1 = "([0-9])";
Pattern pattern1 = Pattern.compile(reg1);
Matcher matcher1 = pattern1.matcher(suffix);
if(matcher1.find()){
System.out.println(prefix
+suffix.toLowerCase());
}
char array [] = suffix.toCharArray();
//标识字符串的某个位置是字母还是非字母
boolean flag [] = new boolean [array.length];
int n = 1; //字符串大小写组合的总数
int count = 0; //统计给定的字符串中包含的字母
个数
for (int i = 0; i < array.length; i++) {
if (Character.isLetter(array[i])) {
flag[i] = true; //是字母
n *= 2; //每出现一个字母,组合
的总数乘以2
count++;
} else {
flag[i] = false; //非字母
}
}
try {
int num = 0;
//BufferedOutputStream out = new
BufferedOutputStream(new FileOutputStream("D://link.txt"));
//打印出每一种字符串组合
for (int i = 0; i < n; i++) {
//将0~n-1转化为二进制数字
String temp =
Integer.toBinaryString(i);
StringBuilder sb = new
StringBuilder();
for (int j = 0; j < count -
temp.length(); j++) {
//追加‘0’,将0变为0000
的形式
sb.append("0");
}
sb.append(temp);
String str = "";
char tempArray [] = sb.toString
().toCharArray();
int k = 0;
for (int j = 0; j < flag.length;
j++) {
char val = array[j]; //
先取出该位置上的字符
if (flag[j]) { //该位置
上是字母
if ('0' ==
tempArray[k]) { //小写
//System.out.print(Character.toLowerCase(val));
str +=
Character.toLowerCase(val);
} else { //大写
//System.out.print(Character.toUpperCase(val));
str +=
Character.toUpperCase(val);
}
k++;
} else { //该位置上非字
母
//System.out.print(val);
str += val;
}
}
//str += "\n";
str = prefix + str;
//byte[] b = str.getBytes();
//out.write(b, 0, b.length);
reg = "([E|e|o|H|Q|Q|
Xhttps://wap.ha.10086.cn/business/work-order-repair.action?
EKYEOhQqx])";
pattern = Pattern.compile(reg);
matcher = pattern.matcher(str);
if(matcher.find()) {
num ++;
System.out.println(str);
if(num % 8 == 0) {
System.out.println("");
}
}
}
//刷新缓冲
//out.flush();
//out.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
scanner.close();
}
}
//好了