Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int faktorial = 0;
- int vysledok = 1;
- char opakovat = ' ';
- while(true)
- {
- vysledok = 1;
- cout << "Napiste faktorial: ";
- cin >> faktorial;
- for(int i = 0; i < faktorial; i++)
- {
- cout << (faktorial - i) << "*" << vysledok << endl;
- vysledok = ((faktorial - i) * vysledok);
- }
- cout << "Vysledok: " << vysledok << endl;
- cout << "Chcete opakovat [a/n]?";
- cin >> opakovat;
- if(opakovat == 'n')
- {
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement