#include <stdio.h>
#include <stdlib.h>
int get_prime_number(unsigned long);
int main(void)
{
unsigned long number, i, count;
printf("Please enter a number:\n");
scanf("%lu", &number);
if(1 > number && COUNTS < number){
fprintf(stderr, "Out of range!\n");
exit(1);
}
for(i = 2, count = 0; i < number; i++)
count += get_prime_number(i);
printf("\nprime number: %lu\n", count);
return 0;
}
int get_prime_number(unsigned long a)
{
unsigned long i;
#include <stdlib.h>
#define COUNTS 4294967295
/*******************************************************
Author:Stat&陈
*******************************************************/
int get_prime_number(unsigned long);
int main(void)
{
unsigned long number, i, count;
printf("Please enter a number:\n");
scanf("%lu", &number);
if(1 > number && COUNTS < number){
fprintf(stderr, "Out of range!\n");
exit(1);
}
for(i = 2, count = 0; i < number; i++)
count += get_prime_number(i);
printf("\nprime number: %lu\n", count);
return 0;
}
int get_prime_number(unsigned long a)
{
unsigned long i;