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 = 0i<11i++){
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+=c<4? charA():charB()
continue
}
n++
str+=n<5? 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)
}
public static void main(String[] args){Scanner sc = new Scanner(System.in)
boolean flag = false
System.out.println("请输入车牌号知拆滚!")
do{
String carNumber = sc.next()
flag = carNumber.matches("(?i)^(CA|AZ|CO)[0-9]{4}$")
if(!flag){
System.out.println("车牌号不正确,请重新搭余输入!")
}else{
System.out.println("车牌号正确!车牌御腊号为:"+carNumber.toUpperCase())
}
}while(!flag)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)