WiktoriaRatajczyk

Zadanie 16

Mar 31st, 2020
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void DZIELNIKI (int n) {
  6.     int i;
  7.     for (i=1; i<=n; i++) /*na poczatku stwierdzilam ze podzielic to podzielic i wyskakiwal mi blad :) */{
  8.         if (n%i==0) cout<<i<<" ";
  9.     }
  10. }
  11.  
  12. int main()
  13. {
  14.     DZIELNIKI(23);
  15.     cout<<endl;
  16.  
  17.     DZIELNIKI(25);
  18.     cout<<endl;
  19.  
  20.     DZIELNIKI(16);
  21.     cout<<endl;
  22.  
  23.     DZIELNIKI(125);
  24.     cout<<endl;
  25.  
  26.     DZIELNIKI(77);
  27.     cout<<endl;
  28. }
Add Comment
Please, Sign In to add comment