/home/toolbox/public_html/solutions/103/10302/a.c
1 #include <stdio.h>
2 #include <string.h>
3 #include <sys/types.h>
4 #include <sys/stat.h>
5 #include <fcntl.h>
6 #include <stdint.h>
7 #include <math.h>
8 #include <stdlib.h>
9 #include <ctype.h>
10
11 #define TRUE (1 == 1)
12 #define FALSE (1 != 1)
13
14 #define DEBUG if (FALSE)
15
16 #define MAX_LINE 257
17
18 /*
19 * Author: Isaac Traxler
20 * Date:
21 * Purpose: fun
22 * Problem:
23 */
24
25 /*
26 * This template reads lines of data at a time until end of file.
27 */
28
29 #define MAX_CACHE 50002
30
31 int num;
32 long long cache[MAX_CACHE];
33
34 void init()
35 {
36 /* FUNCTION init */
37 int i;
38 long long tmp;
39 long long prev = 1;
40
41 cache[0] = 0;
42 cache[1] = 1;
43 for (i=2; MAX_CACHE>i; i++)
44 {
45 /* for */
46 tmp = i;
47 cache[i] = prev + (tmp * tmp * tmp);
48 prev = cache[i];
49 } /* for */
50 } /* FUNCTION init */
51
52 void dump()
53 {
54 /* FUNCTION dump */
55 } /* FUNCTION dump */
56
57 int getInput()
58 {
59 /* FUNCTION getInput */
60 int dataReadFlag;
61
62 dataReadFlag = (1 == scanf(" %d ", &num));
63 return (dataReadFlag);
64 } /* FUNCTION getInput */
65
66 void process()
67 {
68 /* FUNCTION process */
69 printf("%lld\n", cache[num]);
70 } /* FUNCTION process */
71
72 int main()
73 {
74 /* main */
75 int moreToDo;
76
77 init();
78 moreToDo = getInput();
79 while (moreToDo)
80 {
81 /* while */
82 process();
83 moreToDo = getInput();
84 } /* while */
85
86 return EXIT_SUCCESS;
87 } /* main */
88