Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdlib.h>
  3. #include<stdio.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. cout<<"Podaj liczbe dzielnikow: ";
  9. int dziel;
  10. cin>>dziel;
  11. for(int i=1;i<250;i++)
  12.     {
  13.         int n=0;
  14.         for(int j=1;j<=i;j++)
  15.         {
  16.             if(i%j==0)
  17.                 n++;
  18.  
  19.         }  
  20.         if (dziel==n)
  21.             cout<<i<<endl;
  22.  
  23.     }
  24. system("pause");
  25. return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement