重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
[\u4e00-\u9fa5]{1}[A-Z]{1}[A-Z_0-9]{5}
成都网络公司-成都网站建设公司成都创新互联公司十载经验成就非凡,专业从事成都网站建设、网站建设,成都网页设计,成都网页制作,软文发布平台,1元广告等。十载来已成功提供全面的成都网站建设方案,打造行业特色的成都网站建设案例,建站热线:18980820575,我们期待您的来电!
部队的车牌号好像有特殊的,比如WJ01什么的,这个正则不包括
package demo;
import java.util.Scanner;
public class CarCard {
//浙A 杭州,浙B 宁波,浙C 温州,浙D 绍兴,浙E 湖州,浙F 嘉兴,浙G 金华,浙H 衢州,浙J 台州,浙K 丽水,浙L 舟山
//网上搜的,应该是对的,这个东西应该管你要
public static void main(String[] args) {
System.out.println("请输入车牌号");
Scanner sc = new Scanner(System.in);
String carno = sc.next();
String t = carno.substring(0,2);
checkAddressByCarCard(t);
}
private static void checkAddressByCarCard(String no){
String a[]={"浙A","浙B","浙C","浙D","浙E","浙F","浙G","浙H","浙J","浙K","浙L"};
String b[]={"杭州","宁波","温州","绍兴","湖州","嘉兴","金华","衢州","台州","丽水","舟山"};
int index = 0;
for(int i = 0;i11;i++){
if(no.equalsIgnoreCase(a[i])){
index=i;
System.out.println("车辆所在地为:"+b[i]);
}
}
}
}
//不严谨,但是基本功能实现了
public static void main(String[] args) {
String str= "";
int n=0;
int c=0;
for (int i = 0; i 7; i++) {
if(flag()){
c++;
str+=c4? charA():charB();
continue;
}
n++;
str+=n5? charB():charA();
}
System.out.println(str);
}
private static boolean flag(){
int i=(int) (Math.random()*1000);
return i%2==0;
}
private static String charA(){
return ""+(char)(Math.random()*26+'A');
}
private static String charB(){
return ""+(int)(Math.random()*10);
}