Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<math.h>
- using namespace std;
- int main() {
- int a, b, suma = 0, d = 0,r,f;
- cout << "Podaj przedzial" << endl;
- cin >> a >> b;
- for (int i = a; i <= b; i++) {
- suma = 0;
- for (int j = 2; j <= i; j++) {
- r = i % j;
- if (r == 0) {
- suma++;
- }
- }
- if (suma > d) {
- d = suma;
- f = i;
- }
- }
- cout << f << endl;
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement