大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
package demo;
创新互联建站2013年开创至今,是专业互联网技术服务公司,拥有项目成都网站设计、成都网站制作、外贸网站建设网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元渝北做网站,已为上家服务,为渝北各地企业和个人服务,联系电话:18980820575
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]);
}
}
}
}
//不严谨,但是基本功能实现了
String cph="WJ12345";
Pattern pattern = Pattern.compile("^[\u4e00-\u9fa5|WJ]{1}[A-Z0-9]{6}$");
Matcher matcher = pattern.matcher(cph);
if (!matcher.matches()) {
System.out.println("车牌号格式不对!");
}else{
System.out.println("车牌号格式正确!");
}
能的,比如云脉的车牌识别系统的API开发就可以支持Java、C++、C、object pascal及 objective-C等多种语言。
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);
}
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);
}