#include #include using namespace std; int main(){ cout << setprecision(23); for (int n : {12, 13, 14, 21, 23, 26, 35, 171, 1754, 1755}) { int iP=1; unsigned int uiP=1; long int liP=1; unsigned long int uliP=1; float fP=1; double dP=1; long double ldP=1; for ( int c=1 ; (int)c<=n ; c++) iP*=c; for ( unsigned int c=1 ; (int)c<=n ; c++) uiP*=c; for ( long int c=1 ; (int)c<=n ; c++) liP*=c; for (unsigned long int c=1 ; (int)c<=n ; c++) uliP*=c; for ( float c=1 ; (int)c<=n ; c++) fP*=c; for ( double c=1 ; (int)c<=n ; c++) dP*=c; for ( long double c=1 ; (int)c<=n ; c++) ldP*=c; cout << endl; cout << n << "! = iP = " << iP << endl; cout << n << "! = uiP = " << uiP << endl; cout << n << "! = liP = " << liP << endl; cout << n << "! = uliP = " << uliP << endl; cout << n << "! = fP = " << fP << endl; cout << n << "! = dP = " << dP << endl; cout << n << "! = ldP = " << ldP << endl; } cout << "\nΣωστά αποτελέσματα:\n" " 26! = 403291461126605635584000000\n" " 35! = 10333147966386144929666651337523200000000\n" " 171! = " "1241018070217667823424840524103103992616605577501693185388951803611996" "0752216917529927519781204875855764649595016703870528098898586907107673" "3124203221848436431047357788996854827829075454156196485215346831804429" "3239598173696899657235903947616152278558180061176365108428800000000000" "000000000000000000000000000000\n" "1755! = " "3473604617134292647195049044819723187091966071546125936435581023087787" "9367849264087208328040945788563785672438235129178245453214674794051675" "9896874824921941613901498464521512079131063314193446115382048068437926" "7336384346117951174208404891697493709095272839852524186806527522507196" "1659702872497749876160646090691621110287036096191165403188284882846528" "9318717463965141527115381423248026680219497435022244931537804902476231" "4839550848953012270394339902753994579461327500105596631216532631875046" "2545722819736042380032382507885639419511279804206172017201287709613198" "4145804481172748779132981855730423465975321270740913443163680409443190" "6549424379490799173736171509589263109426432859628083818335520139756270" "7016108782943508372926202274515714806918592747511643571981444407996055" "3612856444043948136284887444854430139708114586216196420956451378253341" "6420707455524102140299580401728703424416098559253365202510960348147650" "2391137325608704718134504567696662502046067757569994678300813214667777" "1227205440384815855233743606971815926659780919295044273807857202670205" "1567305414071891611822099621566215754903770965380166358794016371220979" "0772401294318852789999068141007878676722247248176218850085255285699941" "3889589212772397498545896043771725750266703571761210582168936486715916" "2864107139088458891699138467240440476991492124115168767131271041048453" "9337130162745603572146355821652753806518062214089059430182022236524800" "1436214487135592706404702832209363734972450235792330352604231733494132" "0421765979546033405843231154624259490361871380231695454788968423623471" "8062216272185707457204140751202359749378951739407938552819920735556626" "5861604632380400931151145070854396878388653636151647132054183940189416" "1683495835028446376613687729773071112968274270610503525304024263859575" "1651311510154822090440071842327069526157699521389658862497512599192280" "2463661267199823613759548635402851540786595861164856841513316244553732" "7921740641321715111205114695585928808762700251323783660454949182305411" "4479118911088134032198017953934849336308212724034168920782622829685496" "2003911355638735714824829337703475467631885913673353843166244169869915" "5832394574134942571602384648589614698367767413352944450875540368061771" "7181634090360330428127649824585626546865116351452684719466602063246592" "5398449408015893369184617564589103146546809810458822273547109219997753" "9592688663306465972476356884645227312734065719319664425159764444791987" "4869235779133102084987792810122088667728735938629749322362425457092426" "9466002316985630261745832677841818349242270587167087223153790348584378" "3271617192313652287754667865108709809893504759771057593450546441422271" "4273751631203324605440150208863317315900801888942207321834067596843293" "6187699402933689452976044105485255758534621196175699156744249951432685" "2316251724206528645550481952578657307508845220564199069590234449591511" "4626012131763120938324640391351802153428629600523730284710046578233984" "7995439708034248779168006443348564180020444708797489718840511241806663" "8692623736343348877407142264853801811889470465901897125063713731192482" "1380694590189495987567114079914187348590080441131877602020164762724767" "7975429287730830908038720917676665406058200900976981619119037769072797" "7857375773438214847786965136805745577780495903913834971341920843003129" "4077684580305960663299098674456439839353424094012649203627189287405258" "0167273133954630566411903912191168233507479909628166340040754201447326" "1339939357540321705632734776050774402964262919751018269598838629075330" "3442969875222855861804565541471075580628432175149913619602676273966339" "3227576345890507244619250158003036233130190363146939096489528579192302" "9835343668659453888102319429990633054710382712087585929004433508551395" "4418292767459249577401407068699249469406009304286731959797984996254781" "2204628772835582096852524494898873224419840561746739889240333491262801" "3268572885067415113308216092677688476132540045641970055943569502977457" "3493330236340923383225754686273165682128780648610966288609637075448449" "6546682220255515277906227840621087468171618086639406567476629194490210" "3708937506734175554086718070288427935228028510078359401376465857963791" "2588206336625360108938629270749110014365727175116890221904711912361938" "9373313734896091673888524552066288409791125853690296692771220137571440" "5969429573819503468728742277707362608831401272274139389986496813525894" "3581887969344386965511668549646275905277627782253580421675388798667220" "7200793413579939404029493538399578857040613430241647324088906998844798" "5478472900390476771046232075958059814149845999023743256723953292009471" "7491085082991001600000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000\n"; }