Problem 7 solution.
More...
#include <stdio.h>
|
int | main () |
| Main function.
|
|
Problem 7 solution.
- See also
- Faster version problem_7/sol.c
◆ main()
Main function.
- Returns
- 0 on exit
12{
13 int n;
14 scanf("%d", &n);
15 int number_of_prime = 0;
16 for (int i = 2;; i++)
17 {
19 for (int j = 1; j <= i; j++)
20 {
21 if (i % j == 0)
22 {
24 }
25 }
27 {
28 number_of_prime++;
29 if (number_of_prime == n)
30 {
31 printf("%d", i);
32 break;
33 }
34 }
35 }
36
37 return 0;
38}
static unsigned int divisors[]
Hack to store divisors between 1 & 20.
Definition sol2.c:21