幽默人生重开模拟器

可以按照人口比例得出的概率预测下一次投胎会在哪个国家或地区。
其实应该按照出生人口的但是没找到数据。
https://wwcl.lanzn.com/igaEE285u2jc
密码:gzij
居然是自己一个一个复制的国家人口数量
代码:

#include<iostream>
#include<string>
#include<vector>
#include<random>
#include<ctime>
#include<cstdlib>
typedef unsigned long long ull;
class Country{
	private:
	std::string s;
	ull n;
	public:
	Country(){
		s=std::string();
		n=0;
	}
	Country(std::string _s,ull _n){
		s=_s;
		n=_n;
	}
	Country(const char*_s,ull _n){
		s=_s;
		n=_n;
	}
	std::string&name(){
		return s;
	}
	ull&population(){
		return n;
	}
};
std::vector<Country>countrylist;
void inscountry(Country x){
	countrylist.push_back(x);
}
void initIndia(){
	inscountry(Country("India",1450935791));
}
void initChina(){
	inscountry(Country("China",1419321278));
}
void initUnitedStates(){
	inscountry(Country("United States",345426571));
}
void initIndonesia(){
	inscountry(Country("Indonesia",283487931));
}
void initPakistan(){
	inscountry(Country("Pakistan",251269164));
}
void initNigeria(){
	inscountry(Country("Nigeria",232679478));
}
void initBrazil(){
	inscountry(Country("Brazil",211998573));
}
void initBangladesh(){
	inscountry(Country("Bangladesh",173562364));
}
void initRussia(){
	inscountry(Country("Russia",144820423));
}
void initEthiopia(){
	inscountry(Country("Ethiopia",132059767));
}
void initMexico(){
	inscountry(Country("Mexico",130861007));
}
void initJapan(){
	inscountry(Country("Japan",123753041));
}
void initEgypt(){
	inscountry(Country("Egypt",116538258));
}
void initPhilippines(){
	inscountry(Country("Philippines",115843670));
}
void initDRCongo(){
	inscountry(Country("DR Congo",109276265));
}
void initVietnam(){
	inscountry(Country("Vietnam",100987686));
}
void initIran(){
	inscountry(Country("Iran",91567738));
}
void initTurkey(){
	inscountry(Country("Turkey",87473805));
}
void initGermany(){
	inscountry(Country("Germany",84552242));
}
void initThailand(){
	inscountry(Country("Thailand",71668011));
}
void initUnitedKingdom(){
	inscountry(Country("United Kingdom",69138192));
}
void initTanzania(){
	inscountry(Country("Tanzania",68560157));
}
void initFrance(){
	inscountry(Country("France",66548530));
}
void initSouthAfrica(){
	inscountry(Country("South Africa",64007187));
}
void initItaly(){
	inscountry(Country("Italy",59342867));
}
void initKenya(){
	inscountry(Country("Kenya",56432944));
}
void initMyanmar(){
	inscountry(Country("Myanmar",54500091));
}
void initColombia(){
	inscountry(Country("Colombia",52886363));
}
void initSouthKorea(){
	inscountry(Country("South Korea",51717590));
}
void initSudan(){
	inscountry(Country("Sudan",50448963));
}
void initUganda(){
	inscountry(Country("Uganda",50015092));
}
void initSpain(){
	inscountry(Country("Spain",47910526));
}
void initAlgeria(){
	inscountry(Country("Algeria",46814308));
}
void initIraq(){
	inscountry(Country("Iraq",46042015));
}
void initArgentina(){
	inscountry(Country("Argentina",45696159));
}
void initAfghanistan(){
	inscountry(Country("Afghanistan",42647492));
}
void initYemen(){
	inscountry(Country("Yemen",40583164));
}
void initCanada(){
	inscountry(Country("Canada",39742430));
}
void initPoland(){
	inscountry(Country("Poland",38539201));
}
void initMorocco(){
	inscountry(Country("Morocco",38081173));
}
void initAngola(){
	inscountry(Country("Angola",37885849));
}
void initUkraine(){
	inscountry(Country("Ukraine",37860221));
}
void initUzbekistan(){
	inscountry(Country("Uzbekistan",36361859));
}
void initMalaysia(){
	inscountry(Country("Malaysia",35557673));
}
void initMozambique(){
	inscountry(Country("Mozambique",34631766));
}
void initGhana(){
	inscountry(Country("Ghana",34427414));
}
void initPeru(){
	inscountry(Country("Peru",34217848));
}
void initSaudiArabia(){
	inscountry(Country("Saudi Arabia",33962757));
}
void initMadagascar(){
	inscountry(Country("Madagascar",31964956));
}
void initCotedIvoire(){
	inscountry(Country("Cote d'Ivoire",31934230));
}
void initNepal(){
	inscountry(Country("Nepal",29651054));
}
void initCameroon(){
	inscountry(Country("Cameroon",29123744));
}
void initVenezuela(){
	inscountry(Country("Venezuela",28405543));
}
void initNiger(){
	inscountry(Country("Niger",27032412));
}
void initAustralia(){
	inscountry(Country("Australia",26713205));
}
void initNorthKorea(){
	inscountry(Country("North Korea",26498823));
}
void initSyria(){
	inscountry(Country("Syria",24672760));
}
void initMali(){
	inscountry(Country("Mali",24478595));
}
void initBurkinaFaso(){
	inscountry(Country("Burkina Faso",23548781));
}
void initTaiwan(){
	inscountry(Country("China Taiwan",23213962));
}
void initSriLanka(){
	inscountry(Country("Sri Lanka",23103565));
}
void initMalawi(){
	inscountry(Country("Malawi",21655286));
}
void initZambia(){
	inscountry(Country("Zambia",21314956));
}
void initKazakhstan(){
	inscountry(Country("Kazakhstan",20592571));
}
void initChad(){
	inscountry(Country("Chad",20299123));
}
void initChile(){
	inscountry(Country("Chile",19764771));
}
void initRomania(){
	inscountry(Country("Romania",19015088));
}
void initSomalia(){
	inscountry(Country("Somalia",19009151));
}
void initSenegal(){
	inscountry(Country("Senegal",18501984));
}
void initGuatemala(){
	inscountry(Country("Guatemala",18406359));
}
void initNetherlands(){
	inscountry(Country("Netherlands",18228742));
}
void initEcuador(){
	inscountry(Country("Ecuador",18135478));
}
void initCambodia(){
	inscountry(Country("Cambodia",17638801));
}
void initZimbabwe(){
	inscountry(Country("Zimbabwe",16634373));
}
void initGuinea(){
	inscountry(Country("Guinea",14754785));
}
void initBenin(){
	inscountry(Country("Benin",14462724));
}
void initRwanda(){
	inscountry(Country("Rwanda",14256567));
}
void initBurundi(){
	inscountry(Country("Burundi",14047786));
}
void initBolivia(){
	inscountry(Country("Bolivia",12413315));
}
void initTunisia(){
	inscountry(Country("Tunisia",12277109));
}
void initSouthSudan(){
	inscountry(Country("South Sudan",11943408));
}
void initHaiti(){
	inscountry(Country("Haiti",11772557));
}
void initBelgium(){
	inscountry(Country("Belgium",11738763));
}
void initJordan(){
	inscountry(Country("Jordan",11552876));
}
void initDominicanRepublic(){
	inscountry(Country("Dominican Republic",11427557));
}
void initUnitedArabEmirates(){
	inscountry(Country("United Arab Emirates",11027129));
}
void initCuba(){
	inscountry(Country("Cuba",10979783));
}
void initHonduras(){
	inscountry(Country("Honduras",10825703));
}
void initCzechRepublicCzechia(){
	inscountry(Country("Czech Republic (Czechia)",10735859));
}
void initSweden(){
	inscountry(Country("Sweden",10606999));
}
void initTajikistan(){
	inscountry(Country("Tajikistan",10590927));
}
void initPapuaNewGuinea(){
	inscountry(Country("Papua New Guinea",10576502));
}
void initPortugal(){
	inscountry(Country("Portugal",10425292));
}
void initAzerbaijan(){
	inscountry(Country("Azerbaijan",10336577));
}
void initGreece(){
	inscountry(Country("Greece",10047817));
}
void initHungary(){
	inscountry(Country("Hungary",9676135));
}
void initTogo(){
	inscountry(Country("Togo",9515236));
}
void initIsrael(){
	inscountry(Country("Israel",9387021));
}
void initAustria(){
	inscountry(Country("Austria",9120813));
}
void initBelarus(){
	inscountry(Country("Belarus",9056696));
}
void initSwitzerland(){
	inscountry(Country("Switzerland",8921981));
}
void initSierraLeone(){
	inscountry(Country("Sierra Leone",8642022));
}
void initLaos(){
	inscountry(Country("Laos",7769819));
}
void initTurkmenistan(){
	inscountry(Country("Turkmenistan",7494498));
}
void initHongKong(){
	inscountry(Country("China Hong Kong",7414909));
}
void initLibya(){
	inscountry(Country("Libya",7381023));
}
void initKyrgyzstan(){
	inscountry(Country("Kyrgyzstan",7186009));
}
void initParaguay(){
	inscountry(Country("Paraguay",6929153));
}
void initNicaragua(){
	inscountry(Country("Nicaragua",6916140));
}
void initBulgaria(){
	inscountry(Country("Bulgaria",6757689));
}
void initSerbia(){
	inscountry(Country("Serbia",6736216));
}
void initElSalvador(){
	inscountry(Country("El Salvador",6338193));
}
void initCongo(){
	inscountry(Country("Congo",6332961));
}
void initDenmark(){
	inscountry(Country("Denmark",5977412));
}
void initSingapore(){
	inscountry(Country("Singapore",5832387));
}
void initLebanon(){
	inscountry(Country("Lebanon",5805962));
}
void initFinland(){
	inscountry(Country("Finland",5617310));
}
void initLiberia(){
	inscountry(Country("Liberia",5612817));
}
void initNorway(){
	inscountry(Country("Norway",5576660));
}
void initSlovakia(){
	inscountry(Country("Slovakia",5506760));
}
void initStateofPalestine(){
	inscountry(Country("State of Palestine",5495443));
}
void initCentralAfricanRepublic(){
	inscountry(Country("Central African Republic",5330690));
}
void initOman(){
	inscountry(Country("Oman",5281538));
}
void initIreland(){
	inscountry(Country("Ireland",5255017));
}
void initNewZealand(){
	inscountry(Country("New Zealand",5213944));
}
void initMauritania(){
	inscountry(Country("Mauritania",5169395));
}
void initCostaRica(){
	inscountry(Country("Costa Rica",5129910));
}
void initKuwait(){
	inscountry(Country("Kuwait",4934507));
}
void initPanama(){
	inscountry(Country("Panama",4515577));
}
void initCroatia(){
	inscountry(Country("Croatia",3875325));
}
void initGeorgia(){
	inscountry(Country("Georgia",3807670));
}
void initEritrea(){
	inscountry(Country("Eritrea",3535603));
}
void initMongolia(){
	inscountry(Country("Mongolia",3475540));
}
void initUruguay(){
	inscountry(Country("Uruguay",3386588));
}
void initPuertoRico(){
	inscountry(Country("Puerto Rico",3242204));
}
void initBosniaandHerzegovina(){
	inscountry(Country("Bosnia and Herzegovina",3164253));
}
void initQatar(){
	inscountry(Country("Qatar",3048423));
}
void initMoldova(){
	inscountry(Country("Moldova",3034961));
}
void initNamibia(){
	inscountry(Country("Namibia",3030131));
}
void initArmenia(){
	inscountry(Country("Armenia",2973840));
}
void initLithuania(){
	inscountry(Country("Lithuania",2973840));
}
void initJamaica(){
	inscountry(Country("Jamaica",2839175));
}
void initAlbania(){
	inscountry(Country("Albania",2791765));
}
void initGambia(){
	inscountry(Country("Gambia",2759988));
}
void initGabon(){
	inscountry(Country("Gabon",2538952));
}
void initBotswana(){
	inscountry(Country("Botswana",2521139));
}
void initLesotho(){
	inscountry(Country("Lesotho",2337423));
}
void initGuineaBissau(){
	inscountry(Country("Guinea-Bissau",2201352));
}
void initSlovenia(){
	inscountry(Country("Slovenia",2118697));
}
void initEquatorialGuinea(){
	inscountry(Country("Equatorial Guinea",1892516));
}
void initLatvia(){
	inscountry(Country("Latvia",1871871));
}
void initNorthMacedonia(){
	inscountry(Country("North Macedonia",1823009));
}
void initBahrain(){
	inscountry(Country("Bahrain",1607049));
}
void initTrinidadandTobago(){
	inscountry(Country("Trinidad and Tobago",1507782));
}
void initTimorLeste(){
	inscountry(Country("TimorLeste",1400638));
}
void initEstonia(){
	inscountry(Country("Estonia",1360546));
}
void initCyprus(){
	inscountry(Country("Cyprus",1358282));
}
void initMauritius(){
	inscountry(Country("Mauritius",1271169));
}
void initEswatini(){
	inscountry(Country("Eswatini",1242822));
}
void initDjibouti(){
	inscountry(Country("Djibouti",1168722));
}
void initFiji(){
	inscountry(Country("Fiji",928784));
}
void initReunion(){
	inscountry(Country("Reunion",878591));
}
void initComoros(){
	inscountry(Country("Comoros",866628));
}
void initGuyana(){
	inscountry(Country("Guyana",831087));
}
void initSolomonIslands(){
	inscountry(Country("Solomon Islands",819198));
}
void initBhutan(){
	inscountry(Country("Bhutan",791524));
}
void initMacao(){
	inscountry(Country("China Macao",720262));
}
void initLuxembourg(){
	inscountry(Country("Luxembourg",673036));
}
void initMontenegro(){
	inscountry(Country("Montenegro",638479));
}
void initSuriname(){
	inscountry(Country("Suriname",634431));
}
void initWesternSahara(){
	inscountry(Country("Western Sahara",590506));
}
void initMalta(){
	inscountry(Country("Malta",539607));
}
void initMaldives(){
	inscountry(Country("Maldives",527799));
}
void initMicronesia(){
	inscountry(Country("Micronesia",526923));
}
void initCaboVerde(){
	inscountry(Country("Cabo Verde",524877));
}
void initBrunei(){
	inscountry(Country("Brunei",462721));
}
void initBelize(){
	inscountry(Country("Belize",417072));
}
void initBahamas(){
	inscountry(Country("Bahamas",401283));
}
void initIceland(){
	inscountry(Country("Iceland",393396));
}
void initGuadeloupe(){
	inscountry(Country("Guadeloupe",375106));
}
void initMartinique(){
	inscountry(Country("Martinique",343195));
}
void initVanuatu(){
	inscountry(Country("Vanuatu",327777));
}
void initMayotte(){
	inscountry(Country("Mayotte",326505));
}
void initFrenchGuiana(){
	inscountry(Country("French Guiana",308522));
}
void initNewCaledonia(){
	inscountry(Country("New Caledonia",292639));
}
void initBarbados(){
	inscountry(Country("Barbados",282467));
}
void initFrenchPolynesia(){
	inscountry(Country("French Polynesia",281807));
}
void initSaoTomePrincipe(){
	inscountry(Country("Sao Tome & Principe",235536));
}
void initSamoa(){
	inscountry(Country("Samoa",218019));
}
void initCuracao(){
	inscountry(Country("Curacao",185482));
}
void initSaintLucia(){
	inscountry(Country("Saint Lucia",179744));
}
void initGuam(){
	inscountry(Country("Guam",167777));
}
void initKiribati(){
	inscountry(Country("Kiribati",134518));
}
void initSeychelles(){
	inscountry(Country("Seychelles",130418));
}
void initGrenada(){
	inscountry(Country("Grenada",117207));
}
void initAruba(){
	inscountry(Country("Aruba",108066));
}
void initTonga(){
	inscountry(Country("Tonga",104175));
}
void initStVincentGrenadines(){
	inscountry(Country("St. Vincent & Grenadines",100616));
}
void initAntiguaandBarbuda(){
	inscountry(Country("Antigua and Barbuda",93772));
}
void initUSVirginIslands(){
	inscountry(Country("U.S. Virgin Islands",84905));
}
void initIsleofMan(){
	inscountry(Country("Isle of Man",84160));
}
void initAndorra(){
	inscountry(Country("Andorra",81938));
}
void initCaymanIslands(){
	inscountry(Country("Cayman Islands",74457));
}
void initDominica(){
	inscountry(Country("Dominica",66205));
}
void initBermuda(){
	inscountry(Country("Bermuda",64636));
}
void initGreenland(){
	inscountry(Country("Greenland",55840));
}
void initFaeroeIslands(){
	inscountry(Country("Faeroe Islands",55400));
}
void initSaintKittsNevis(){
	inscountry(Country("Saint Kitts & Nevis",46843));
}
void initAmericanSamoa(){
	inscountry(Country("American Samoa",46765));
}
void initTurksandCaicos(){
	inscountry(Country("Turks and Caicos",46535));
}
void initNorthernMarianaIslands(){
	inscountry(Country("Northern Mariana Islands",44278));
}
void initSintMaarten(){
	inscountry(Country("Sint Maarten",43350));
}
void initLiechtenstein(){
	inscountry(Country("Liechtenstein",39870));
}
void initBritishVirginIslands(){
	inscountry(Country("British Virgin Islands",39471));
}
void initGibraltar(){
	inscountry(Country("Gibraltar",39329));
}
void initMonaco(){
	inscountry(Country("Monaco",38631));
}
void initMarshallIslands(){
	inscountry(Country("Marshall Islands",37548));
}
void initSanMarino(){
	inscountry(Country("San Marino",33581));
}
void initCaribbeanNetherlands(){
	inscountry(Country("Caribbean Netherlands",30675));
}
void initSaintMartin(){
	inscountry(Country("Saint Martin",26129));
}
void initPalau(){
	inscountry(Country("Palau",17695));
}
void initAnguilla(){
	inscountry(Country("Anguilla",14598));
}
void initCookIslands(){
	inscountry(Country("Cook Islands",13729));
}
void initNauru(){
	inscountry(Country("Nauru",11947));
}
void initWallisFutuna(){
	inscountry(Country("Wallis & Futuna",11277));
}
void initSaintBarthelemy(){
	inscountry(Country("Saint Barthelemy",11258));
}
void initTuvalu(){
	inscountry(Country("Tuvalu",9646));
}
void initSaintPierreMiquelon(){
	inscountry(Country("Saint Pierre & Miquelon",5628));
}
void initSaintHelena(){
	inscountry(Country("Saint Helena",5237));
}
void initMontserrat(){
	inscountry(Country("Montserrat",4389));
}
void initFalklandIslands(){
	inscountry(Country("Falkland Islands",3470));
}
void initTokelau(){
	inscountry(Country("Tokelau",2506));
}
void initNiue(){
	inscountry(Country("Niue",1819));
}
void initHolySee(){
	inscountry(Country("Holy See",496));
}
void initcountry(){
	initIndia();
	initChina();
	initUnitedStates();
	initIndonesia();
	initPakistan();
	initNigeria();
	initBrazil();
	initBangladesh();
	initRussia();
	initEthiopia();
	initMexico();
	initJapan();
	initEgypt();
	initPhilippines();
	initDRCongo();
	initVietnam();
	initIran();
	initTurkey();
	initGermany();
	initThailand();
	initUnitedKingdom();
	initTanzania();
	initFrance();
	initSouthAfrica();
	initItaly();
	initKenya();
	initMyanmar();
	initColombia();
	initSouthKorea();
	initSudan();
	initUganda();
	initSpain();
	initAlgeria();
	initIraq();
	initArgentina();
	initAfghanistan();
	initYemen();
	initCanada();
	initPoland();
	initMorocco();
	initAngola();
	initUkraine();
	initUzbekistan();
	initMalaysia();
	initMozambique();
	initGhana();
	initPeru();
	initSaudiArabia();
	initMadagascar();
	initCotedIvoire();
	initNepal();
	initCameroon();
	initVenezuela();
	initNiger();
	initAustralia();
	initNorthKorea();
	initSyria();
	initMali();
	initBurkinaFaso();
	initTaiwan();
	initSriLanka();
	initMalawi();
	initZambia();
	initKazakhstan();
	initChad();
	initChile();
	initRomania();
	initSomalia();
	initSenegal();
	initGuatemala();
	initNetherlands();
	initEcuador();
	initCambodia();
	initZimbabwe();
	initGuinea();
	initBenin();
	initRwanda();
	initBurundi();
	initBolivia();
	initTunisia();
	initSouthSudan();
	initHaiti();
	initBelgium();
	initJordan();
	initDominicanRepublic();
	initUnitedArabEmirates();
	initCuba();
	initHonduras();
	initCzechRepublicCzechia();
	initSweden();
	initTajikistan();
	initPapuaNewGuinea();
	initPortugal();
	initAzerbaijan();
	initGreece();
	initHungary();
	initTogo();
	initIsrael();
	initAustria();
	initBelarus();
	initSwitzerland();
	initSierraLeone();
	initLaos();
	initTurkmenistan();
	initHongKong();
	initLibya();
	initKyrgyzstan();
	initParaguay();
	initNicaragua();
	initBulgaria();
	initSerbia();
	initElSalvador();
	initCongo();
	initDenmark();
	initSingapore();
	initLebanon();
	initFinland();
	initLiberia();
	initNorway();
	initSlovakia();
	initStateofPalestine();
	initCentralAfricanRepublic();
	initOman();
	initIreland();
	initNewZealand();
	initMauritania();
	initCostaRica();
	initKuwait();
	initPanama();
	initCroatia();
	initGeorgia();
	initEritrea();
	initMongolia();
	initUruguay();
	initPuertoRico();
	initBosniaandHerzegovina();
	initQatar();
	initMoldova();
	initNamibia();
	initArmenia();
	initLithuania();
	initJamaica();
	initAlbania();
	initGambia();
	initGabon();
	initBotswana();
	initLesotho();
	initGuineaBissau();
	initSlovenia();
	initEquatorialGuinea();
	initLatvia();
	initNorthMacedonia();
	initBahrain();
	initTrinidadandTobago();
	initTimorLeste();
	initEstonia();
	initCyprus();
	initMauritius();
	initEswatini();
	initDjibouti();
	initFiji();
	initReunion();
	initComoros();
	initGuyana();
	initSolomonIslands();
	initBhutan();
	initMacao();
	initLuxembourg();
	initMontenegro();
	initSuriname();
	initWesternSahara();
	initMalta();
	initMaldives();
	initMicronesia();
	initCaboVerde();
	initBrunei();
	initBelize();
	initBahamas();
	initIceland();
	initGuadeloupe();
	initMartinique();
	initVanuatu();
	initMayotte();
	initFrenchGuiana();
	initNewCaledonia();
	initBarbados();
	initFrenchPolynesia();
	initSaoTomePrincipe();
	initSamoa();
	initCuracao();
	initSaintLucia();
	initGuam();
	initKiribati();
	initSeychelles();
	initGrenada();
	initAruba();
	initTonga();
	initStVincentGrenadines();
	initAntiguaandBarbuda();
	initUSVirginIslands();
	initIsleofMan();
	initAndorra();
	initCaymanIslands();
	initDominica();
	initBermuda();
	initGreenland();
	initFaeroeIslands();
	initSaintKittsNevis();
	initAmericanSamoa();
	initTurksandCaicos();
	initNorthernMarianaIslands();
	initSintMaarten();
	initLiechtenstein();
	initBritishVirginIslands();
	initGibraltar();
	initMonaco();
	initMarshallIslands();
	initSanMarino();
	initCaribbeanNetherlands();
	initSaintMartin();
	initPalau();
	initAnguilla();
	initCookIslands();
	initNauru();
	initWallisFutuna();
	initSaintBarthelemy();
	initTuvalu();
	initSaintPierreMiquelon();
	initSaintHelena();
	initMontserrat();
	initFalklandIslands();
	initTokelau();
	initNiue();
	initHolySee();
}
void readenter(){
	char c=getchar();
	for(;c!='\n';c=getchar());
}
int main(){
	std::cout<<"Waiting..."<<std::endl;
	initcountry();
	ull sum=0;
	for(int i=0;i<countrylist.size();i++)sum+=countrylist[i].population();
	std::mt19937_64 gen(time(0));
	std::uniform_int_distribution<ull>rnd(1,sum);
	system("cls");
	std::cout<<"Taiwan,Hong Kong and Macao is a part of china but I'm too lazy to repair the data."<<std::endl;
	std::cout<<"Press Enter to start"<<std::endl;
	readenter();
	system("cls");
	for(;;){
		std::cout<<"Type 1 if you want to know where will you go after remaking."<<std::endl;
		std::cout<<"Type 2 if you want to know how many times do you need to remake to go to a place you want to live."<<std::endl;
		std::cout<<"Type 3 if you want to read the list of countries and territories."<<std::endl; 
		std::cout<<"Type 4 if you want to end \"remake.exe.\""<<std::endl; 
		ull op;
		std::cin>>op;
		readenter();
		system("cls");
		if(op==1){
			ull x=rnd(gen);
			for(int i=0;i<countrylist.size();i++){
				if(x<=countrylist[i].population()){
					std::cout<<"You are born in "<<countrylist[i].name()<<"."<<std::endl;
					break;
				}
				x-=countrylist[i].population();
			}
		}
		else if(op==2){
			std::string want;
			std::cout<<"Write the name of country and territory you want to go."<<std::endl;
			std::getline(std::cin,want);
			int pos=-1;
			for(int i=0;i<countrylist.size();i++)if(countrylist[i].name()==want){
				pos=i;
				break;
			}
			if(pos==-1){
				std::cout<<"The country and territory doesn't exist."<<std::endl;
			}
			else{
				int cnt=0;
				for(;;cnt++){
					ull x=rnd(gen);
					int res=0;
					for(int i=0;i<countrylist.size();i++){
						if(x<=countrylist[i].population()){
							std::cout<<"You are born in "<<countrylist[i].name()<<"."<<std::endl;
							res=i;
							break;
						}
						x-=countrylist[i].population();
					}
					if(res==pos){
						std::cout<<"The count of remaking is "<<cnt<<"."<<std::endl;
						break;
					}
				}
			}
		}
		else if(op==3){
			for(int i=0;i<countrylist.size();i++)std::cout<<countrylist[i].name()<<std::endl; 
		}
		else if(op==4){
			return 0;
		}
		else{
			std::cout<<"Read a wrong number."<<std::endl;
		}
		std::cout<<"Press Enter to continue."<<std::endl;
		readenter();
		system("cls");
	}
	return 0;
} 
posted @ 2024-08-22 20:27  junjunccc  阅读(43)  评论(0编辑  收藏  举报