File: prime.cpp

package info (click to toggle)
yrmcds 1.0.4-6
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 924 kB
  • ctags: 1,346
  • sloc: cpp: 9,634; sh: 133; makefile: 97
file content (17 lines) | stat: -rw-r--r-- 390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <cybozu/hash_map.hpp>

#include <iostream>

void show_nearest_prime(unsigned int n) {
    std::cout << "nearest_prime(" << n << ") = "
              << cybozu::nearest_prime(n) << std::endl;
}

int main() {
    for( int i = 0; i <= 20; ++i )
        show_nearest_prime(i);
    show_nearest_prime(1024);
    show_nearest_prime(2<<20);
    show_nearest_prime(2<<30);
    return 0;
}