Կարելի է օգտագործել __int64 տիպը ( Microsoft Visual Studio 2008 )
Բայց ամենալավ արդյունքը ( առանց հատուկ կլասներ կազմելու ) կստացվի այս դեպքում
Կոդ:
#include<iostream.h>
#include<cstdlib>
#include<stdio.h>
// Hashvum a tveri factorial@ ( minchev 170 )
int main ()
{
unsigned short n ;
double result = 1 ;
cout << "Mutqagreq inch vor tiv , vor stanaq ayd tvi factorial@" << endl << endl;
cin >> n ;
cout << endl;
for ( short i=1;i <= n;i++)
result*=i;
printf("Aha ayd tvi factorial@ ____ ");
printf ("%f",result);
cout << endl << endl;
system("pause");
return 0;
}
Էջանիշներ