Advertisement
pierdziadek

#1 - Informatyka - 16.03.2020

Mar 16th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int ilosc, n[30];
  6. long wynik;
  7.  
  8. int main() {
  9.     cin >> ilosc;
  10.     for(int i = 0; i < ilosc; i++) cin >> n[i];
  11.     for(int i = 0; i < ilosc; i ++) {
  12.         wynik = 1;
  13.         for(int j = 1; j < n[i]+1; j++) {
  14.             wynik = wynik *j;
  15.         }
  16.         cout << wynik/10%10 << " " << wynik%10 << endl;
  17.     }
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement