Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. int suma, c, b, z;
  7. srand( time( NULL ) );
  8. z=(rand()%100);
  9. cout<<"Podaj liczbe przez ktora chcesz dzielic: ";
  10. cin>>b;
  11. cout<<"Podaj zakres: ";
  12.  
  13. for (c=0; c<=z; c++)
  14. {
  15. if(c%b!=0)
  16. {
  17. suma=suma+c;
  18. cout<<c<<endl;
  19. }
  20. }
  21. cout<<suma;
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement