Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Algorytm 3
- // a - początek przedziału
- // b- koniec przedziału
- // c - zmienna dodatkowa, do sprawdzania podzielności przez 3
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int a,b,c;
- cout << "a=";
- cin >> a;
- cout << "b=";
- cin >> b;
- while(b<a){
- cout << "b=";
- cin >> b;
- }
- for(c=a;c<=b;c++){
- if(c%3==0){
- cout << c << ", ";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement