无题 acmer 必知必会.pptVIP

  • 4
  • 0
  • 约1.02万字
  • 约 50页
  • 2015-10-06 发布于河南
  • 举报
无题 acmer 必知必会

理论篇 Prime Count (NOJ 1004/1108) Description Given two nonnegative integers a, b (=1000000), calculate how many primes between a and b (include a, b ); Input Input will consist of multiple input sets. Each set include two integers; Output For each input set, output a single integer consisting of the number of prime numbers between a and b; Sample Input 3 9 Sample Output 3 理论篇 bool isPrime(int a) { if (a 2) return false; if (a == 2) return true; for(int i = 2; i = sqrt(a); i++) if (a % i == 0)return false; return true; } int main() { int a, b, count; while(scanf(%d%d, a, b

文档评论(0)

1亿VIP精品文档

相关文档