/*
* Copyright and version Declaration of the program:
* Copyright (c) 2012, computer College, Yantai University
* All rights reserved.
* File name:. cpp
* Author: Mao Tong
* Completion date: January 1, October 2012
* Version No.: v1.0
* Description of tasks and solutions:
* Input Description: None
* Problem description:
* Program output: ""
* Problem Analysis: omitted
* Algorithm Design: omitted
*/
[Cpp]
# Include <iostream>
# Include <cmath>
# Include <iomanip>
Using namespace std;
Int main ()
{
Int m, k, I, n = 0;
Bool prime; // defines the Boolean prime variable.
For (m = 101; m <= 200; m = m + 2) // determine whether m is a prime number.
{Prime = true; // set prime to true at the beginning of the loop
K = int (sqrt (m ));
For (I = 2; I <= k; I ++)
If (m % I = 0)
{Prime = false;
Break;
}
If (prime)
{Cout <setw (5) <m;
N = n + 1; // n is used to accumulate the number of prime numbers.
}
If (n % 10 = 0) cout <endl; // output 10 numbers before line feed
}
Cout <endl;
Return 0;
}
/*
Running result:
Experience:
Knowledge Point summary:
*/