Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
spoj BCFACT v1.01
SUBMITTED BY:
Guest
DATE:
Feb. 16, 2014, 9:04 a.m.
FORMAT:
C++
SIZE:
507 Bytes
Raw
Download
Tweet
HITS:
1257
Go to comments
Report
//Haha TTpro
//BCFACT
//http://www.spoj.com/PTIT/problems/BCFACT/
#include
<iostream>
using
namespace
std
;
long
long
int
giaithua
(
int
a
);
int
main
()
{
int
a
;
long
long
int
s
;
while
(
true
)
{
cin
>>
a
;
if
(
a
==
0
)
break
;
s
=
giaithua
(
a
);
cout
<<
s
<<
endl
;
}
}
long
long
int
giaithua
(
int
a
)
{
long
long
int
s
=
1
;
int
i
;
for
(
i
=
1
;
i
<=
a
;
i
++
)
{
s
=
s
*
i
;
}
return
s
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus