Last active
October 20, 2017 23:31
-
-
Save Mozart2234/069161ea34a7f927c4c1aaa13ec5b5f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int i; | |
int x; | |
cout << "Ingrese un valor: "; | |
cin >> i; | |
cout << "Ingrese otro valor mayor que el primero: "; | |
cin >> x; | |
int temp = i; | |
while(temp < x){ | |
cout << temp << endl; | |
if(temp < 10){ | |
temp++; | |
} | |
else if(temp < 20 && temp >= 10){ | |
temp +=2; | |
} | |
else if(temp < 30 && temp >= 20 ){ | |
temp +=3; | |
} | |
else{ | |
temp++; | |
} | |
} | |
temp = x; | |
while(temp > i){ | |
if(temp < 10){ | |
temp--; | |
} | |
else if(temp < 20 && temp >= 10){ | |
temp -=2; | |
} | |
else if(temp < 30 && temp >= 20 ){ | |
temp -=3; | |
} | |
else{ | |
temp--; | |
} | |
cout << temp << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment