摘要:
#include #include // 集成最快排序与查找 #define NUM 8int compare(const void *p, const void *q){ return (*(int *)p - *(int *)q);}int main(int argc, char *argv[]){ int array[NUM] = {9, 2, 7, 11, 3, 87, 34, 6}; int key; scanf("%d",&key); int *p; qsort(array, NUM, sizeof(int), compare); ... 阅读全文
摘要:
bool RabbinMillerTest( unsigned n ){ if (n>= 1; // 右移一位 r++; // 统计右移的次数 } const unsigned nTestCnt = 8; // 表示进行测试的次数 for ( unsigned i = 0; i < nTestCnt; ++i ) { // 利用随机数进行测试, int a = g_aPrimeList[ rand() % nPrimeListSize ]; if ( 1 != Montgomery( a, m, n ) )... 阅读全文
摘要:
#include #include #include #include #include int *primarr, *v;int q = 1, p = 1;//π(n)int pi(int n, int primarr[], int len){ int i = 0, mark = 0; for (i = len - 1; i > 0; i--) { if (primarr[i] n) { if (!mark[j]) s++; j--; ... 阅读全文