#include<stdio.h>     //printf
#include<string.h>    //StringBearbeitung
#include<conio.h>     //getch(),clrscr()
void main(int zahl,char *buffer[]) //Option und KennZeichenerkennung
{
char *code[515]={
"A","AA","AB","ABG","AC","AE","AIC","AK","AM","AN","ANA","ANG","ANK",
"AÖ","APD","ARN","ART","AS","ASL","AT","AU","AUR","AW","AZ","B","BA",
"BAD","BB","BBG","BBL","BC","BD","BED","BEL","BER","BG","BGL","BI",
"BIR","BIT","BIW","BL","BM","BN","BNA","BO","BOR","BOT","BP","BRA",
"BRB","BRG","BS","BSK","BT","BTF","BÜS","BÜZ","BW","BWL","BYL","BZ",
"C","CA","CB","CE","CHA","CLP","CO","COC","COE","CUX","CW","D","DA",
"DAH","DAN","DAU","DB","DBR","DD","DE","DEG","DEL","DGF","DH","DL",
"DLG","DM","DN","DO","DON","DU","DÜW","DW","DZ","E","EB","EBE","ED",
"EF","EH","EI","EIL","EIS","EL","EM","EMD","EMS","EN","ER","ERB",
"ERH","ES","ESA","ESW","EU","EW","F","FB","FD","FDS","FF","FFB","FG",
"FI","FL","FLÖ","FN","FO","FOR","FR","FRG","FRI","FRW","FS","FT",
"FTL","FÜ","FW","G","GA","GAP","GC","GDB","GE","GER","GF","GG","GHA",
"GHC","GI","GL","GM","GMN","GNT","GÖ","GP","GR","GRH","GRM","GRS",
"GRZ","GS","GT","GTH","GUB","GÜ","GVM","GW","GZ","H","HA","HAL","HAM",
"HAS","HB","HBN","HBS","HC","HD","HDH","HDL","HE","HEF","HEI","HEL",
"HER","HET","HF","HG","HGN","HGW","HH","HHM","HI","HIG","HL","HM",
"HN","HO","HOL","HOM","HOT","HP","HR","HRO","HS","HSK","HST","HU",
"HV","HWI","HX","HY","HZ","IGB","IL","IN","IZ","J","JB","JE","K","KA",
"KB","KC","KE","KEH","KF","KG","KH","KI","KIB","KL","KLE","KLZ","KM",
"KN","KO","KÖT","KR","KS","KT","KU","KÜN","KUS","KW","KY","L","LA",
"LAU","LB","LBS","LBZ","LC","LD","LDK","LER","LEV","LG","LI","LIB",
"LIF","LIP","LL","LM","LN","LÖ","LÖB","LSA","LSN","LSZ","LU","LUK",
"LWL","M","MA","MAB","MB","MC","MD","ME","MEI","MER","MG","MGN","MH",
"MHL","MI","MIL","MK","MM","MN","MOS","MR","MS","MSP","MTK","MÜ",
"MVL","MYK","MZ","MZG","N","NAU","NB","ND","NDH","NE","NEA","NEB",
"NES","NEW","NF","NH","NI","NK","NL","NM","NMB","NMS","NOH","NOM",
"NP","NR","NRW","NU","NW","NY","NZ","OA","OAL","OB","OBG","OC","OD",
"OE","OF","OG","OH","OHA","OHZ","OL","OR","OS","OVL","OZ","P","PA",
"PAF","PAN","PB","PCH","PE","PER","PF","PI","PIR","PK","PL","PLÖ",
"PN","PS","PW","PZ","QFT","QLB","R","RA","RC","RD","RDG","RE","REG",
"RH","RIE","RL","RM","RN","RO","ROS","ROW","RPL","RS","RSL","RT","RU",
"RÜD","RÜG","RV","RW","RZ","S","SAD","SAL","SAW","SBG","SBK","SC",
"SCZ","SDH","SDL","SDT","SE","SEB","SEE","SFA","SFB","SFT","SG","SGH",
"SH","SHA","SHG","SHL","SI","SIG","SIM","SK","SL","SLF","SLN","SLS",
"SLZ","SM","SN","SO","SON","SÖM","Sp","SPB","SR","SRB","SRO","ST",
"STA","STB","STD","STL","SU","SÜW","SW","SZ","SZB","TBB","TET","TG",
"THL","TIR","TÖL","TP","TR","TS","TÜ","TUT","UE","UEM","UL","UN","VB",
"VEC","VER","VIE","VK","VS","W","WAF","WB","WBS","WDA","WE","WEN",
"WES","WF","WHV","WI","WIL","WIS","WK","WL","WLG","WM","WMS","WN",
"WND","WO","WOB","WR","WRN","WSF","WST","WSW","WT","WTM","WÜ","WUG",
"WUN","WUR","WW","WZL","X","Y","Z","ZE","ZI","ZP","ZR","ZS","ZW","ZZ",
"0","1-1"," "," "};
char *nam[515]={
"Augsburg","Ostalbkreis in Aalen","Aschaffenburg","Altenburg",
"Aachen","Auerbach","Aichach-Friedberg in Aichach",
"Altenkirchen/Westerwald","Amberg (Stadt)","Ansbach","Annaberg",
"Angermünde","Anklam","Altötting","Apolda","Arnstadt","Artern",
"Amberg-Sulzbach in Amberg","Aschersleben","Altentreptow","Aue",
"Aurich","Bad Neuenahr-Ahrweiler in Ahrweiler","Alzey-Worms in Alzey",
"Berlin","Bamberg","Baden-Baden (Stadt)","Böblingen","Bernburg",
"Brandenburg, Landesregierung und Landtag","Biberach/Riß",
"Bundestag, Bundesrat Bundesregierung","Brand-Erbisdorf","Belzig",
"Bernau","Bundesgrenzschutz",
"Berchtesgadener Land in Bad Reichenhall","Bielefeld (Stadt)",
"Birkenfeld/Nahe und Idar-Oberstein (Stadt)",
"Bitburg-Prüm in Bitburg","Bischofswerda",
"Zollernalbkreis in Balingen","Erftkreis in Bergheim","Bonn (Stadt)",
"Borna","Bochum (Stadt)","Borken in Ahaus","Bottrop (Stadt)",
"Deutsche Bundespost","Wesermarsch in Brake/Unterweser","Brandenburg",
"Burg","Braunschweig (Stadt)","Beeskow","Bayreuth","Bitterfeld",
"Büsingen am Hochrhein","Bützow",
"Bundes-Wasser-und Schiffahrtsverwaltung",
"Baden-Württemberg, Landesregierung und Landtag",
"Bayern, Landesregierung und Landtag","Bautzen","Chemnitz","Calau",
"Cottbus","Celle","Cham","Cloppenburg","Coburg",
"Cochem-Zell in Cochem","Coesfeld/Westfalen","Cuxhaven","Calw",
"Düsseldorf (Stadt)","Darmstadt","Dachau",
"Lüchow-Dannenberg in Lüchow","Daun","Deutsche Bundesbahn",
"Bad Doberan","Dresden","Dessau (Stadt)","Deggendorf",
"Delmenhorst (Stadt)","Dingolfing-Landau in Dingolfing","Diepholz",
"Döbeln","Dillingen/Donau","Demmin","Düren","Dortmund (Stadt)",
"Donau-Ries in Donauwörth","Duisburg (Stadt)",
"Bad Dürkheim/Weinstraße in Neustadt/Weinstraße","Dippoldiswalde",
"Delitzsch","Essen (Stadt)","Eilenburg","Ebersberg","Erding","Erfurt",
"Eisenhüttenstadt","Eichstätt","Eisleben","Eisenberg",
"Emsland in Meppen","Emmendingen","Emden (Stadt)",
"Rhein-Lahn-Kreis in Bad Ems/Lahnstein (Stadt)",
"Ennepe-Ruhr-Kreis in Schwelm","Erlangen (Stadt)",
"Odenwaldkreis in Erbach/Odenwald","Erlangen-Höchstadt in Erlangen",
"Esslingen/Neckar","Eisenach","Werra-Meißner-Kreis in Eschwege",
"Euskirchen","Eberswalde","Frankfurt am Main (Stadt)",
"Wetteraukreis in Friedberg/Hessen","Fulda","Freudenstadt",
"Frankfurt/Oder (Stadt)","Fürstenfeldbruck","Freiberg","Finsterwalde",
"Flensburg (Stadt)","Flöha","Bodenseekreis in Friedrichshafen",
"Forchheim","Forst","Breisgau-Hochschwarzwald und Freiburg (Stadt)",
"Freyung-Grafenau in Freyung","Friesland in Jever","Bad Freienwalde",
"Freising","Frankenthal/Pfalz (Stadt)","Freital","Fürth",
"Fürstenwalde","Gera","Gardelegen","Garmisch-Partenkirchen",
"Glauchau","Gadebusch","Gelsenkirchen (Stadt)","Germersheim",
"Gifhorn","Groß-Gerau","Geithain","Gräfenhainichen","Gießen",
"Rheinisch-Bergischer Kreis in Bergisch Gladbach",
"Oberbergischer Kreis in Gummersbach","Grimmen","Genthin","Göttingen",
"Göppingen","Görlitz","Großenhain","Grimma","Gransee","Greiz",
"Goslar","Gütersloh in Rheda-Wiedenbrück","Gotha","Guben","Güstrow",
"Grevesmühlen","Greifswald (Kreis)","Günzburg","Hannover",
"Hagen/Westfalen (Stadt)","Halle (Stadt)","Hamm/Westfalen (Stadt)",
"Haßberge in Haßfurt","Hansestadt Bremen und Bremerhaven",
"Hildburghausen","Halberstadt","Hainichen",
"Rhein-Neckar-Kreis und Heidelberg (Stadt)","Heidenheim/Brenz",
"Haldensleben","Helmstedt","Hersfeld-Rotenburg in Bad Hersfeld",
"Dithmarschen in Heide/Holstein",
"Hessen, Landesregierung und Landtag","Herne (Stadt)","Hettstedt",
"Herford in Kirchlengern",
"Hochtaunuskreis in Bad Homburg vor der Höhe","Hagenow",
"Hansestadt Greifswald","Hansestadt Hamburg","Mohenmölsen",
"Hildesheim","Heiligenstadt","Hansestadt Lübeck",
"Hameln-Pyrmont in Hameln","Heilbronn/Neckar","Hof","Holzminden",
"Saar-Pfalz in Homburg/Saar","Hohenstein-Ernstthal",
"Bergstraße in Heppenheim/Bergstraße",
"Schwalm-Eder-Kreis in Homberg/Bez. Kassel","Hansestadt Rostock",
"Heinsberg","Hochsauerlandkreis in Meschede","Hansestadt Stralsund",
"Main-Kinzig-Kreis in Hanau","Havelberg","Hansestadt Wismar","Höxter",
"Hoyerswerda","Herzberg","St.Ingbert (Stadt)","Ilmenau",
"Ingolstadt/Donau (Stadt)","Steinburg in Itzehoe","Jena","Jüterbog",
"Jessen","Köln (Stadt)","Karlsruhe","Waldeck-Frankenberg in Korbach",
"Kronach","Kempten/Allgäu (Stadt)","Kelheim","Kaufbeuren (Stadt)",
"Bad Kissingen","Bad Kreuznach","Kiel (Stadt)",
"Donnersberg-Kreis in Kirchheimbolanden","Kaiserslautern","Kleve",
"Klötze","Kamenz","Konstanz","Koblenz (Stadt)","Köthen",
"Krefeld (Stadt)","Kassel","Kitzingen","Kulmbach",
"Hohenlohe-Kreis in Künzelsau","Kusel","Königs Wusterhausen","Kyritz",
"Leipzig","Landshut","Nürnberger Land in Lauf/Pegnitz","Ludwigsburg",
"Lobenstein","Lübz","Luckau","Landau (Stadt)",
"Lahn-Dill-Kreis in Wetzlar","Leer/Ostfriesland","Leverkusen (Stadt)",
"Lüneburg","Lindau/Bodensee","Bad Liebenwerda","Lichtenfels",
"Lippe in Detmold","Landsberg/Lech",
"Limburg-Weilburg in Limburg/Lahn","Lübben","Lörrach","Löbau",
"Sachsen-Anhalt, Landesregierung und Landtag",
"Sachsen, Landesregierung und Landtag","Bad Langensalza",
"Ludwigshafen/Rhein","Luckenwalde","Ludwigslust","München",
"Mannheim (Stadt)","Marienberg","Miesbach","Malchin",
"Magdeburg (Stadt)","Mettmann","Meißen","Merseburg",
"Mönchengladbach (Stadt)","Meiningen","Mülheim/Ruhr (Stadt)",
"Mühlhausen","Minden-Lübbecke in Minden","Miltenberg",
"Märkischer Kreis in Lüdenscheid","Memmingen (Stadt)",
"Unterallgäu in Mindelheim","Neckar-Odenwald-Kreis in Mosbach",
"Marburg-Biedenkopf in Marburg/Lahn","Münster/Westfalen (Stadt)",
"Main-Spessart-Kreis in Karlstadt",
"Main-Taunus-Kreis in Hofheim a. Taunus","Mühldorf a. Inn",
"Mecklenburg-Vorpommern, Landesregierung und Landtag",
"Mayen-Koblenz in Koblenz","Mainz-Bingen und Mainz (Stadt)",
"Merzig-Wadern in Merzig/Saar","Nürnberg (Stadt)","Nauen",
"Neubrandenburg","Neuburg-Schrobenhausen in Neuburg/Donau",
"Nordhausen","Neuss","Neustadt-Bad Windsheim in Neustadt/Aisch",
"Nebra","Rhön-Grabfeld in Bad Neustadt/Saale","Neustadt/Waldnaab",
"Nordfriesland in Husum","Neuhaus","Nienburg/Weser",
"Neunkirchen/Saar","Niedersachsen, Landesregierung und Landtag",
"Neumarkt/Oberpfalz","Naumburg","Neumünster (Stadt)",
"Grafschaft Bentheim in Nordhorn","Northeim","Neuruppin",
"Neuwied/Rhein","Nordrhein-Westfalen, Landesregierung und Landtag",
"Neu-Ulm","Neustadt/Weinstraße (Stadt)","Niesky","Neustrelitz",
"Oberallgäu in Sonthofen","Ostallgau in Marktoberdorf",
"Oberhausen/Rheinland (Stadt)","Osterburg","Oschersleben",
"Stormarn in Bad Oldesloe","Olpe","Offenbach/Main",
"Ortenaukreis in Offenburg","Ostholstein in Eutin","Osterode/Harz",
"Osterholz in Osterholz-Scharmbeck","Oldenburg in Oldenburg",
"Oranienburg","Osnabrück","Obervogtland in Klingenthal und Oelsnitz",
"Oschatz","Potsdam","Passau","Pfaffenhofen/Ilm",
"Rottal-Inn in Pfarrkirchen","Paderborn","Parchim","Peine",
"Perleberg","Enzkreis und Pforzheim (Stadt)","Pinneberg","Pirna",
"Pritzwalk","Plauen","Plön/Holstein","Pößneck","Pirmasens","Pasewalk",
"Prenzlau","Querfurt","Quedlinburg","Regensburg","Rastatt",
"Reichenbach","Rendsburg-Eckernförde in Rendsburg",
"Ribnitz-Damgarten","Recklinghausen in Marl","Regen","Roth","Riesa",
"Rochlitz","Röbel/Müritz","Rathenow","Rosenheim","Rostock (Kreis)",
"Rotenburg/Wümme","Rheinland-Pfalz, Landesregierung und Landtag",
"Remscheid (Stadt)","Roßlau","Reutlingen","Rudolstadt",
"Rheingau-Taunus-Kreis in Bad Schwalbach","Rügen in Bergen",
"Ravensburg","Rottweil","Herzogtum Lauenburg in Ratzeburg",
"Stuttgart (Stadt)","Schwandorf",
"Saarland, Landesregierung und Landtag","Salzwedel","Strasburg",
"Schönebeck","Schwabach (Stadt)","Schleiz","Sondershausen","Stendal",
"Schwedt/Oder (Stadt)","Bad Segeberg","Sebnitz","Seelow",
"Soltau-Fallingbostel in Fallingbostel","Senftenberg","Staßfurt",
"Solingen (Stadt)","Sangerhausen",
"Schleswig-Holstein, Landesregierung und Landtag","Schwäbisch Hall",
"Schaumburg in Stadthagen","Suhl","Siegen","Sigmaringen",
"Rhein-Hunsrück-Kreis in Simmern","Saalkreis in Halle",
"Schleswig-Flensburg in Schleswig","Saalfeld","Schmölln","Saarlouis",
"Bad Salzungen","Schmalkalden","Schwerin","Soest","Sonneberg",
"Sömmerda","Speyer (Stadt)","Spremberg",
"Straubing-Bogen und Straubing (Stadt)","Strausberg","Stadtroda",
"Steinfurt","Starnberg","Sternberg","Stade","Stollberg",
"Rhein-Sieg-Kreis in Siegburg","Südliche Weinstraße in Landau",
"Schweinfurt","Salzgitter (Stadt)","Schwarzenberg",
"Main-Tauber-Kreis in Tauberbischofsheim","Teterow","Torgau",
"Thüringen, Landesregierung und Landtag","Tirschenreuth",
"Bad Tölz-Wolfratshausen in Bad Tölz","Templin",
"Trier-Saarburg und Trier (Stadt)","Traunstein","Tübingen",
"Tuttlingen","Uelzen","Ueckermünde","Alb-Donau-Kreis und Ulm (Stadt)",
"Unna","Vogelsbergkreis in Lauterbach/Hessen","Vechta","Verden/Aller",
"Viersen","Völklingen (Stadt)",
"Schwarzwald-Baar-Kreis in Villingen-Schwenningen",
"Wuppertal (Stadt)","Warendorf in Beckum","Wittenberg","Worbis",
"Werdau","Weimar","Weiden/Oberpfalz (Stadt)","Wesel","Wolfenbüttel",
"Wiihelmshaven (Stadt)","Wiesbaden (Stadt)",
"Bernkastel-Wittlich in Wittlich","Wismar (Kreis)","Wittstock",
"Harburg in Winsen/Luhe","Wolgast",
"Weilheim-Schongau in Weilheim/Oberbayern","Wolmirstedt",
"Rems-Murr-Kreis in Waiblingen","St. Wendel","Worms (Stadt)",
"Wolfsburg (Stadt)","Wernigerode","Waren","Weißenfels",
"Ammerland in Westerstede","Weißwasser",
"Waldshut in Waldshut-Tiengen","Wittmund","Würzburg",
"Weißenburg-Gunzenhausen in Weißenburg/Bayern","Wunsiedel","Wurzen",
"Westerwald-Kreis in Montabaur","Wanzleben",
"Bundeswehr f. Fahrzeuge d. NATO-Hauptquartiere","Bundeswehr",
"Zwickau","Zerbst","Zittau","Zschopau","Zeulenroda","Zossen",
"Zweibrücken (Stadt)","Zeitz","Fahrzeuge des Diplomatischen Corps",
"Dienstkraftwagen des Präsidenten des Deutschen Bundestages",
"\a\n\tDieses Kennzeichen wurde nicht gefunden!"
"\n\toder falsche Option!",
"\n\t\t\tInformationen zum Programm"
"\n\t\t\t============================\n\n"
"\t  Amtliche Kennzeichen für die Bundesrepublik Deutschland"
"\n\t  ======================================================="
"\n\n\n Geben Sie den Programmnamen und das zu suchende Kennzeichen hintereinander"
"\n ein, z.B. kennz.exe A"
"\n Groß- und Kleinbuchstaben werden nicht unterschieden, außer Ä, Ö, Ü."
"\n Freizeichen werden berücksichtigt und verfälschen das Kennzeichen.\n"
"\n mit der Option /L wird ein Listing ausgegeben, das mit den Tasten"
"\n DOWN, UP, PGDN und PGUP gesteuert werden kann."
"\n\n\t\t\t"};

int lv=0,lv1;                               //LaufVariablen
unsigned char c;                            //TastenLeser

 if (zahl!=2) {                 //Nur Info haben ?
  clrscr();                   //BildSchirm löschen
  printf("\n %s",nam[514]);   //Ausgabe inclusive Fehler&Info
  printf("Dave Sun",nam[514]);//Codierte Ausgabe meines Names
    while(kbhit()) c=getch();   //TastenPuffer leeren
    getch();                    //Tastendruck abwarten
    return;}                    //Für diese Optionen jetzt **ENDE**

 lv1=memicmp(buffer[1],"/l",2);                   //ListingOption ?
 if ((lv1==0)&&(_fstrlen(buffer[1])==2)) lv=520;  //ist Option angegeben ?
 //*********************************************************
 //****************** T E I L 1 ****************************
 //*********************************************************
 //Optionen "Nur Informationen zum Programm"
 //         "Falsche Option bzw. Kennzeichen nicht gefunden"
 //         und "Kennzeichen mit Info zum Kennzeichen"
 //*********************************************************
 do{                                                   //Aufsuchen des Zeichens
  lv1=memicmp(buffer[1],code[lv],_fstrlen(buffer[1])); //1. StringVergleich
  if(_fstrlen(code[lv])!=_fstrlen(buffer[1])) lv1=1;  //2. Längenvergleich
 }while((lv1!=0)&&((lv++)<512));                          //Auswertung 1.& 2.
 if (lv<514) {                              //wurde das Kennzeichen gefunden dann
    printf("\n %s  %s",code[lv],nam[lv]);  //Ausgabe inclusive Fehler&Info
    while(kbhit()) c=getch();  //TastenPuffer leeren
    getch();                   //Tastendruck abwarten
    return;}                   //Für diese Optionen jetzt **ENDE**
 //*********************************************************
 //************* E N D E   T E I L 1 ***********************
 //*********************************************************

 // *********************************************
 // ************ T E I L 2 **********************
 // *********************************************
 // Option zum Auflisten der Autokennzeichen mit
 // dazugehöriger Erläuterung.
 // *********************************************
 lv=0;                                               //Startwert auf NULL
 do{                      //*Äußerste TastSchleife*
    clrscr();                                        //Bild löschen
    lv1=0;                                           //StartBild Y-Koord-1
    while(lv1<25){                                   //ZeilenListing
       gotoxy(5,lv1+1);cprintf("%s",code[lv+lv1]);   //KennZeichen
       gotoxy(10,lv1+1);cprintf("%s",nam[lv+(lv1++)]);}//Erläuterung
    do{                                              //*Tast* lesen
       c=getch();                                    //lese Tastaturzeichen
       if (c==0){c=getch();                          //Abfrage SteuerZeichen
   if ((c==73)&&(lv>0)) {lv=lv-24;c=0;}       //PGUP
   if ((c==72)&&(lv>0)) {lv=lv-1;c=0;}        //UP
   if ((c==80)&&(lv<488)){lv=lv+1;c=0; }      //DOWN
   if ((c==81)&&(lv<488)){lv=lv+24;c=0;}}     //PGDN
   if (lv<0)   lv=0;     //RestFehler bei PGUP beseitigen
   if (lv>488) lv=488;   //RestFehler bei PGDN beseitigen
    }while((c!=27)&&(c!=0));    //Schleife *Tast* bei ESC oder Steurng ENDE
 }while (c!=27);          //*Äußerste TastSchleife* bei ESC ENDE
clrscr();                 //besser ist's, für unsere Meister
}                    //************************
       // ******MAIN ENDE*******
       //************************

//****************************************************************************
//********** E I N   P R O G R A M M   V O N   D A V E   S U N ***************
//****************************************************************************