Created
September 15, 2017 00:14
-
-
Save jesuscmadrigal/2466048b4a0ec5ec0dd459fb9b86a13b to your computer and use it in GitHub Desktop.
Factorial
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> | |
#include <string> | |
#include <algorithm> | |
using namespace std; | |
int main () | |
{ | |
int X, Y; | |
double long A; | |
string another; | |
do | |
{ | |
cout<< "Ingresa un numero." << endl; | |
cin>> X; | |
int xD=X; | |
A=X; | |
while (X!=1) | |
{ | |
X=X-1; | |
A=A*X; | |
} cout<< ""<<xD<<"! es: "<<A<<" " << endl; | |
cout<< "¿Quieres probar otro numero?" << endl; | |
cin>> another; | |
transform(another.begin(), another.end(), another.begin(), ::tolower); | |
} while(another=="Si" or another=="si" ); | |
cout<< "Gracias por usar el programa :)" << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment