Last active
November 5, 2019 08:45
-
-
Save pinglunliao/0a9fb57328124859dbfd to your computer and use it in GitHub Desktop.
a149: 乘乘樂 FYI: https://yunlinsong.blogspot.com/2014/10/blog-post.html
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 <cmath> | |
#include <cstdio> | |
using namespace std; | |
int main(void){ | |
int num = 0; | |
int n = 0; | |
long result = 1; | |
while(scanf("%d", &num) != EOF) | |
{ | |
for(int i = 1; i <= num; i++) | |
{ | |
result = 1; | |
scanf("%d", &n); | |
while(n / 10 > 0) | |
{ | |
int r = n % 10; | |
result *= r; | |
n = n / 10; | |
} | |
result *= n; | |
printf("%ld\n", result); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment