Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. cout << "Podaj pierwsza liczbe: ";
  8. int x, y;
  9. int suma = 0;
  10. cin >> x;
  11. cout << "Podaj druga liczbe: ";
  12. cin >> y;
  13. for(int i=x; i<=y; i++)
  14. {
  15. if (i%3==0)
  16. {
  17. suma = suma + i;
  18. }
  19. }
  20. cout <<"Suma: " << suma;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement