-
Notifications
You must be signed in to change notification settings - Fork 0
/
eu0048.cpp
37 lines (29 loc) · 867 Bytes
/
eu0048.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include"eu0048.h"
#include"principal.h"
void eu0048 :: solucion(){
// ---------------------------------------------------- //
tstart = (double)clock()/CLOCKS_PER_SEC;
// ---------------------------------------------------- //
output = 0;
temp_4 = 0;
// ---------------------------------------------------- //
for( unsigned long long i=1; i<=1000; i++ ){
temp_2 = 1;
for( unsigned long long j=1; j<=i; j++ ){
temp_2 = temp_2*i;
temp_2 = temp_2%10000000000;
}
temp_4 = temp_4 + temp_2;
temp_4 = temp_4%10000000000;
}
output = temp_4;
// ---------------------------------------------------- //
tstop = (double)clock()/CLOCKS_PER_SEC;
ttime= tstop-tstart;
// ---------------------------------------------------- //
}
void eu0048 :: printsolution(){
cout << "Euler 0048\n";
cout << "Time: " << ttime << "\n";
cout << output;
}