RafalSobala

zad 16

Mar 30th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int a,wynik=0,b;
  5. void DZIELNIK(int a){
  6.  
  7.     for(int i; i>0; i++){
  8.  
  9.         wynik=wynik+i;
  10.         b=wynik%a;
  11.         if(b==0){
  12.             cout << wynik <<", ";
  13.         }
  14.  
  15.     }
  16. }
  17.  
  18.  
  19.  
  20. int main()
  21. {
  22.     cout << "Podaj liczbe: " << endl;
  23.     cin >> a;
  24.  
  25.     DZIELNIK(a);
  26.  
  27.     return 0;
  28. }
Add Comment
Please, Sign In to add comment