Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <stdlib.h>
- using namespace std;
- int main()
- {
- unsigned long en, m[10] = { 0 }, n[99999] = { 0 }, a[99999] = { 0 };
- while (1) {
- cin >> en;
- for (int k = 0; k < en; k++) {
- cin >> a[k];
- }
- for (int t = 0; t < 100000; t++) {
- n[t] = 1;
- }
- for (int bc = 0; bc < en; bc++) {
- for (int x = 0; x < 10; x++) {
- m[x] = a[bc] % 10;
- a[bc] /= 10;
- n[bc] *= m[x];
- if (a[bc] == 0) {
- goto end;
- }
- }
- end:
- cout << " ";
- m[10] = { 0 };
- }
- cout << endl;
- for (int k = 0 ; k < en; k++) {
- cout << n[k] << endl;
- }
- system("PAUSE");
- system("CLS");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement