p15
This commit is contained in:
parent
780f4e600c
commit
97cef85bd6
1 changed files with 22 additions and 0 deletions
22
p15.c
Normal file
22
p15.c
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
/*
|
||||
* http://projecteuler.net
|
||||
*
|
||||
* Projecteuler - Problem 15
|
||||
* ------------------------
|
||||
* 2010-06-12 Henrik Hautakoski
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
|
||||
int c;
|
||||
double r = 20*2 + 1, v = 1;
|
||||
|
||||
for(c=1; c <= 20; c++)
|
||||
v *= (r - c) / c;
|
||||
printf("%.0f\n", v);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue