Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int wynik = 0, x = 0, mini = 99999, maksi = 0 ;
- bool czyPierwsza(int x){
- if(x > 1)
- {
- for(int i = 2; i*i <= x; ++i)
- {
- if(x%i == 0)
- {
- return false;
- }
- }
- return true;
- }
- }
- int main()
- {
- for(int n = 0; n < 2000; ++n)
- {
- cin >> x;
- if(czyPierwsza(x) == true)
- {
- wynik++;
- if(x > maksi)
- maksi = x;
- if(x < mini)
- mini = x;
- if()
- }
- }
- cout << endl;
- cout << "LIle pierwszych: " << wynik << endl;
- cout << "Najmniejsza: " << mini << endl;
- cout << "Największa: " << maksi << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement