Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Spojek.cpp : Defines the entry point for the console applicatio
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <string>
- #include <time.h>
- using namespace std;
- void otsil()
- {
- char numer[4];
- int r = 0;
- int n;
- int w = 1;
- cin >> n;
- for (int j = 1; j <= n; j++) {
- w *= j;
- }
- while (w % 10 == 0)
- {
- w = w / 10;
- }
- r = w % 10;
- cout << r << endl;
- }
- int main()
- {
- int t;
- cout << "Wprowadz liczbe testow:" << endl;
- cin >> t;
- for (int i = 0; i < t; i++)
- {
- otsil();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement