| CODE |
#include <iostream> using namespace std; string country; int main() { cout<<"enter a country extention:"<<"\n"; cin>>country; if(country=="ad") // these are all the adderess type things i could find cout<<"Andorra"; else if (country=="ae") cout<<"United Arab Emirates"; else if (country=="af") cout<<"Afghanistan"; else if (country=="ag") cout<<"Antigua and Barbuda"; else if (country=="ai") cout<<"Anguilla"; else if (country=="al") cout<<"Albania"; else if (country=="am") cout<<"Armenia"; else if (country=="an") cout<<"Netherlands Antilles"; else if (country=="ao") cout<<"Angola"; else if (country=="aq") cout<<"Antarctica"; else if (country=="ar") cout<<"Argentina"; else if (country=="arpa") cout<<"Old style Arpanet"; else if (country=="as") cout<<"American Samoa"; else if (country=="at") cout<<"Austria"; else if (country=="au") cout<<"Australia"; else if (country=="aw") cout<<"Aruba"; else if (country=="az") cout<<"Azerbaidjan"; else if (country=="ba") cout<<"Bosnia-Herzegovina"; else if (country=="bb") cout<<"Barbados"; else if (country=="bd") cout<<"Bangladesh"; else if (country=="be") cout<<"Belgium"; else if (country=="bf") cout<<"Burkina Faso"; else if (country=="bg") cout<<"Bulgaria"; else if (country=="bh") cout<<"Bahrain"; else if (country=="bi") cout<<"Burundi"; else if (country=="bj") cout<<"Benin"; else if (country=="bm") cout<<"Bermuda"; else if (country=="bn") cout<<"Brunei Darussalam"; else if (country=="bo") cout<<"Bolivia"; else if (country=="br") cout<<"Brazil"; else if (country=="bs") cout<<"Bahamas"; else if (country=="bt") cout<<"Bhutan"; else if (country=="bv") cout<<"Bouvet Island"; else if (country=="bw") cout<<"Botswana"; else if (country=="by") cout<<"Belarus"; else if (country=="bz") cout<<"Belize"; else if (country=="ca") cout<<"Canada"; else if (country=="cc") cout<<"Cocos (Keeling) Islands"; else if (country=="cf") cout<<"Central African Republic"; else if (country=="cg") cout<<"Congo"; else if (country=="ch") cout<<"Switzerland"; else if (country=="ci") cout<<"Ivory Coast (Cote D'Ivoire)"; else if (country=="ck") cout<<"Cook Islands"; else if (country=="cl") cout<<"Chile"; else if (country=="cm") cout<<"Cameroon"; else if (country=="cn") cout<<"China"; else if (country=="co") cout<<"Colombia"; else if (country=="com") cout<<"Commercial"; else if (country=="cr") cout<<"Costa Rica"; else if (country=="cs") cout<<"Former Czechoslovakia"; else if (country=="cu") cout<<"Cuba"; else if (country=="cv") cout<<"Cape Verde"; else if (country=="cx") cout<<"Christmas Island"; else if (country=="cy") cout<<"Cyprus"; else if (country=="cz") cout<<"Czech Republic"; else if (country=="de") cout<<"Germany"; else if (country=="dj") cout<<"Djibouti"; else if (country=="dk") cout<<"Denmark"; else if (country=="dm") cout<<"Dominica"; else if (country=="do") cout<<"Dominican Republic"; else if (country=="dz") cout<<"Algeria"; else if (country=="ec") cout<<"Ecuador"; else if (country=="edu") cout<<"Educational"; else if (country=="ee") cout<<"Estonia"; else if (country=="eg") cout<<"Egypt"; else if (country=="eh") cout<<"Western Sahara"; else if (country=="es") cout<<"Spain"; else if (country=="et") cout<<"Ethiopia"; else if (country=="fi") cout<<"Finland"; else if (country=="fj") cout<<"Fiji"; else if (country=="fk") cout<<"Falkland Islands"; else if (country=="fm") cout<<"Micronesia"; else if (country=="fo") cout<<"Faroe Islands"; else if (country=="fr") cout<<"France"; else if (country=="fx") cout<<"France (European Territory)"; else if (country=="ga") cout<<"Gabon"; else if (country=="gb") cout<<"Great Britain"; else if (country=="gd") cout<<"Grenada"; else if (country=="ge") cout<<"Georgia"; else if (country=="gf") cout<<"French Guyana"; else if (country=="gh") cout<<"Ghana"; else if (country=="gi") cout<<"Gibraltar"; else if (country=="gl") cout<<"Greenland"; else if (country=="gm") cout<<"Gambia"; else if (country=="gn") cout<<"Guinea"; else if (country=="gov") cout<<"USA Government"; else if (country=="gp") cout<<"Guadeloupe (French)"; else if (country=="gq") cout<<"Equatorial Guinea"; else if (country=="gr") cout<<"Greece"; else if (country=="gs") cout<<"S. Georgia & S. Sandwich Isls."; else if (country=="gt") cout<<"Guatemala"; else if (country=="gu") cout<<"Guam (USA)"; else if (country=="gw") cout<<"Guinea Bissau"; else if (country=="gy") cout<<"Guyana"; else if (country=="hk") cout<<"Hong Kong"; else if (country=="hm") cout<<"Heard and McDonald Islands"; else if (country=="hn") cout<<"Honduras"; else if (country=="hr") cout<<"Croatia"; else if (country=="ht") cout<<"Haiti"; else if (country=="hu") cout<<"Hungary"; else if (country=="id") cout<<"Indonesia"; else if (country=="ie") cout<<"Ireland"; else if (country=="il") cout<<"Israel"; else if (country=="in") cout<<"India"; else if (country=="int") cout<<"International"; else if (country=="io") cout<<"British Indian Ocean Territory"; else if (country=="iq") cout<<"Iraq"; else if (country=="ir") cout<<"Iran"; else if (country=="is") cout<<"Iceland"; else if (country=="it") cout<<"Italy"; else if (country=="jm") cout<<"Jamaica"; else if (country=="jo") cout<<"Jordan"; else if (country=="jp") cout<<"Japan"; else if (country=="ke") cout<<"Kenya"; else if (country=="kg") cout<<"Kyrgyzstan"; else if (country=="kh") cout<<"Cambodia"; else if (country=="ki") cout<<"Kiribati"; else if (country=="km") cout<<"Comoros"; else if (country=="kn") cout<<"Saint Kitts & Nevis Anguilla"; else if (country=="kp") cout<<"North Korea"; else if (country=="kr") cout<<"South Korea"; else if (country=="kw") cout<<"Kuwait"; else if (country=="ky") cout<<"Cayman Islands"; else if (country=="kz") cout<<"Kazakhstan"; else if (country=="ky") cout<<"Cayman Islands"; else if (country=="la") cout<<"Laos"; else if (country=="lb") cout<<"Lebanon"; else if (country=="lc") cout<<"Saint Lucia"; else if (country=="li") cout<<"Liechtenstein"; else if (country=="lk") cout<<"Sri Lanka"; else if (country=="lr") cout<<"Liberia"; else if (country=="ls") cout<<"Lesotho"; else if (country=="lt") cout<<"Lithuania"; else if (country=="lu") cout<<"Luxembourg"; else if (country=="lv") cout<<"Latvia"; else if (country=="ly") cout<<"Libya"; else if (country=="ma") cout<<"Morocco"; else if (country=="mc") cout<<"Monaco"; else if (country=="md") cout<<"Moldavia"; else if (country=="mg") cout<<"Madagascar"; else if (country=="mh") cout<<"Marshall Islands"; else if (country=="mil") cout<<"USA Military"; else if (country=="mk") cout<<"Macedonia"; else if (country=="ml") cout<<"Mali"; else if (country=="mm") cout<<"Myanmar"; else if (country=="mn") cout<<"Mongolia"; else if (country=="mo") cout<<"Macau"; else if (country=="mp") cout<<"Northern Mariana Islands"; else if (country=="mq") cout<<"Martinique (French)"; else if (country=="mr") cout<<"Mauritania"; else if (country=="ms") cout<<"Montserrat"; else if (country=="mt") cout<<"Malta"; else if (country=="mu") cout<<"Mauritius"; else if (country=="mv") cout<<"Maldives"; else if (country=="mw") cout<<"Malawi"; else if (country=="mx") cout<<"Mexico"; else if (country=="my") cout<<"Malaysia"; else if (country=="mz") cout<<"Mozambique"; else if (country=="na") cout<<"Namibia"; else if (country=="nato") cout<<"NATO (purged in '96-see hq.nato.int)"; else if (country=="nc") cout<<"New Caledonia (French)"; else if (country=="ne") cout<<"Niger"; else if (country=="net") cout<<"Network"; else if (country=="nf") cout<<"Norfolk Island"; else if (country=="ng") cout<<"Nigeria"; else if (country=="ni") cout<<"Nicaragua"; else if (country=="nl") cout<<"Netherlands"; else if (country=="no") cout<<"Norway"; else if (country=="np") cout<<"Nepal"; else if (country=="nr") cout<<"Nauru"; else if (country=="nt") cout<<"Neutral Zone"; else if (country=="nu") cout<<"Niue"; else if (country=="nz") cout<<"New Zealand"; else if (country=="om") cout<<"Oman"; else if (country=="org") cout<<"Non-Profit Organisations"; else if (country=="pa") cout<<"Panama"; else if (country=="pe") cout<<"Peru"; else if (country=="pf") cout<<"Polynesia (French)"; else if (country=="pg") cout<<"Papua New Guinea"; else if (country=="ph") cout<<"Philippines"; else if (country=="pk") cout<<"Pakistan"; else if (country=="pl") cout<<"Poland"; else if (country=="pm") cout<<"Saint Pierre and Miquelon"; else if (country=="pn") cout<<"Pitcairn Island"; else if (country=="pr") cout<<"Puerto Rico"; else if (country=="pt") cout<<"Portugal"; else if (country=="pw") cout<<"Palau"; else if (country=="py") cout<<"Paraguay"; else if (country=="qa") cout<<"Qatar"; else if (country=="re") cout<<"Reunion (French)"; else if (country=="ro") cout<<"Romania"; else if (country=="ru") cout<<"Russian Federation"; else if (country=="rw") cout<<"Rwanda"; else if (country=="sa") cout<<"Saudi Arabia"; else if (country=="sb") cout<<"Solomon Islands"; else if (country=="sc") cout<<"Seychelles"; else if (country=="sd") cout<<"Sudan"; else if (country=="se") cout<<"Sweden"; else if (country=="sg") cout<<"Singapore"; else if (country=="sh") cout<<"Saint Helena"; else if (country=="si") cout<<"Slovenia"; else if (country=="sj") cout<<"Svalbard and Jan Mayen Islands"; else if (country=="sk") cout<<"Slovak Republic"; else if (country=="sl") cout<<"Sierra Leone"; else if (country=="sm") cout<<"San Marino"; else if (country=="sn") cout<<"Senegal"; else if (country=="so") cout<<"Somalia"; else if (country=="sr") cout<<"Suriname"; else if (country=="st") cout<<"Saint Tome (Sao Tome) and Principe"; else if (country=="su") cout<<"Former USSR"; else if (country=="sv") cout<<"El Salvador"; else if (country=="sy") cout<<"Syria"; else if (country=="sz") cout<<"Swaziland"; else if (country=="tc") cout<<"Turks and Caicos Islands"; else if (country=="td") cout<<"Chad"; else if (country=="tf") cout<<"French Southern Territories"; else if (country=="tg") cout<<"Togo"; else if (country=="th") cout<<"Thailand"; else if (country=="tj") cout<<"Tadjikistan"; else if (country=="tk") cout<<"Tokelau"; else if (country=="tm") cout<<"Turkmenistan"; else if (country=="tn") cout<<"Tunisia"; else if (country=="tn") cout<<"Tunisia"; else if (country=="to") cout<<"Tonga"; else if (country=="tp") cout<<"East Timor"; else if (country=="tr") cout<<"Turkey"; else if (country=="tt") cout<<"Trinidad and Tobago"; else if (country=="tv") cout<<"Tuvalu"; else if (country=="tw") cout<<"Taiwan"; else if (country=="tz") cout<<"Tanzania"; else if (country=="ua") cout<<"Ukraine"; else if (country=="ug") cout<<"Uganda"; else if (country=="uk") cout<<"United Kingdom"; else if (country=="um") cout<<"USA Minor Outlying Islands"; else if (country=="us") cout<<"United States"; else if (country=="uy") cout<<"Uruguay"; else if (country=="uz") cout<<"Uzbekistan"; else if (country=="va") cout<<"Vatican City State"; else if (country=="vc") cout<<"Saint Vincent & Grenadines"; else if (country=="ve") cout<<"Venezuela"; else if (country=="vg") cout<<"Virgin Islands (British)"; else if (country=="vi") cout<<"Virgin Islands (USA)"; else if (country=="vn") cout<<"Vietnam"; else if (country=="vu") cout<<"Vanuatu"; else if (country=="wf") cout<<"Wallis and Futuna Islands"; else if (country=="ws") cout<<"Samoa"; else if (country=="ye") cout<<"Yemen"; else if (country=="yt") cout<<"Mayotte"; else if (country=="yu") cout<<"Yugoslavia"; else if (country=="za") cout<<"South Africa"; else if (country=="zm") cout<<"Zambia"; else if (country=="zr") cout<<"Zaire"; else if (country=="zw") cout<<"Zimbabwe"; else if (country=="end") system("exit"); else cout<<"unknown or invalid country"; //an error message cout<<"\n\n"; if (country !="end") // recursive part that starts main over again main(); // if the country value is not "end" return 0; } |
| QUOTE |
| i was gonna do that but since my variable stated out with char[6] it wouldent work right.. |
| CODE |
| int ip1,ip2,ip3,ip4; void ipfind() { cout<<"enter an IP adderess in 4 parts:"; cin>>ip1; cin>>ip2; cin>>ip3; cin>>ip4; //LAN reserved adderesses if(ip1==10 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "local area network.","Finished IP Search",MB_OK); else if(ip1==172 && ip2 > 15 && ip2 < 132&& ip3<=255 && ip4<=255 ) MessageBox (NULL, "local area network.","Finished IP Search",MB_OK);//got logic help at cpplc else if(ip1==192 && ip2==168&& ip3<=255 && ip4<=255 ) MessageBox (NULL, "local area network.","Finished IP Search",MB_OK); //north and south america caribbiean sub sahara africa else if(ip1==63 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North America, South America,\n the Caribbean and sub-Saharan Africa","Finished IP Search",MB_OK); else if(ip1==64 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North America, South America,\n the Caribbean and sub-Saharan Africa","Finished IP Search",MB_OK); else if(ip1==196 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North America, South America,\n the Caribbean and sub-Saharan Africa","Finished IP Search",MB_OK); else if(ip1==198 xor ip1==199 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North America, South America,\n the Caribbean and sub-Saharan Africa","Finished IP Search",MB_OK); else if(ip1==200 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North America, South America,\n the Caribbean and sub-Saharan Africa","Finished IP Search",MB_OK); else if(ip1<208 && ip1>203 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North America, South America,\n the Caribbean and sub-Saharan Africa","Finished IP Search",MB_OK); else if(ip1==208 xor ip1==209 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North America, South America,\n the Caribbean and sub-Saharan Africa","Finished IP Search",MB_OK); else if(ip1==216 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North America, South America,\n the Caribbean and sub-Saharan Africa","Finished IP Search",MB_OK); //Asia Pacific, from Afghanistan , to Pitcairn in Pacific else if(ip1==24 && ip2<196 && ip2>191 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "Asia Pacific, from Afghanistan in\n the Middle East, to Pitcairn in the Pacific Ocean","Finished IP Search",MB_OK); else if(ip1==169 && ip2<224 && ip2>207 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "Asia Pacific, from Afghanistan in\n the Middle East, to Pitcairn in the Pacific Ocean","Finished IP Search",MB_OK); else if(ip1==161 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "Asia Pacific, from Afghanistan in\n the Middle East, to Pitcairn in the Pacific Ocean","Finished IP Search",MB_OK); else if(ip1<204 && ip1>201 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "Asia Pacific, from Afghanistan in\n the Middle East, to Pitcairn in the Pacific Ocean","Finished IP Search",MB_OK); else if(ip1<212 && ip1>209 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "Asia Pacific, from Afghanistan in\n the Middle East, to Pitcairn in the Pacific Ocean","Finished IP Search",MB_OK); else if(ip1==218 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "Asia Pacific, from Afghanistan in\n the Middle East, to Pitcairn in the Pacific Ocean","Finished IP Search",MB_OK); //now for RIPE net... whatever that is else if(ip1==24 && ip2<136 && ip2>131 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==62 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==139 && ip2<30 && ip2>19 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==141 && ip2<=85 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==145 && ip2<255 && ip2>223 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==149 && ip2<205 && ip2>201 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==149 && ip2<252 && ip2>205 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==150 && ip2==254 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==151 && ip2<82 && ip2>12 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==151 && ip2<6 && ip2>2 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==151 && ip2<6 && ip2>2 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==151 && ip2==82 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==151 && ip2<94 && ip2>90 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==151 && ip2==95 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==160 && ip2<221 && ip2>215 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==160 && ip2<64 && ip2>43 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==163 && ip2<176 && ip2>155 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==164 && ip2<41 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==164 && ip2<144 && ip2>127 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==171 && ip2<34 && ip2>15 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==192 && ip2==106 && ip3<198 && ip3>195 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==192 && ip2==162 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==192 && ip2<168 && ip2>163 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==192 && ip2==71 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==193 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==194 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==195 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==198 && ip2==17 && ip3==117 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==212 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==213 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); else if(ip1==217 && ip2<=255 && ip3<=255 && ip4<=255 ) MessageBox (NULL, "North Africa, Russia \n and the Middle East, Eurpoen","Finished IP Search",MB_OK); system("pause"); } |