Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int sum(int min, int max)
- {
- if(min<max)
- return sum(min+1, max) + min;
- }
- int main()
- {
- int min, max;
- cout << "PODAJ MINIMALNA LICZBE PRZEDZIALU : ";
- cin >> min;
- cout << "PODAJ MAKSYMALNA LICZBE PRZEDZIALU : ";
- cin >> max;
- cout << "WYNIK WSZYSTKICH LICZB JEDNOCYFROWYCH ROWNA SIE : " << sum(min, max) << endl << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement