Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- int main() {
- int rosnaco, malejaco, liczba_zestawow;
- cout << "Wprowadz liczbe zestawow: " << endl;
- cin >> liczba_zestawow;
- for (int licznik = 0; licznik < liczba_zestawow; ++licznik) {
- int a, b;
- string sort;
- cout << endl << "Podaj " << licznik+1 << " zestaw: " << endl;
- cin >> a >> b;
- cout << "Rosnaco czy malejaco?" << endl;
- cin >> sort;
- cout << endl << "Wynik: " << endl;
- cout << sort;
- if (sort == "rosnaco") {
- if (a > b) {
- for (int n = a; n <= b; n++) {
- cout << n << endl;;
- }
- } else {
- cout << a;
- }
- }
- else if (sort == "malejaco") {
- if (a < b) {
- for (int i = b; i >= a; i--) {
- cout << i << endl;
- }
- }
- }
- else {
- cout << "zle";
- }
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement