2011-08-03 17:57:42Morris
a149. 乘乘樂
垃圾題就拿來練短碼
/**********************************************************************************/
/* Problem: a149 "乘乘樂" from */
/* Language: C */
/* Result: AC (2ms, 226KB) on ZeroJudge */
/* Author: morris1028 at 2011-08-03 17:35:04 */
/**********************************************************************************/
#include<stdio.h>
main() {
int a, n, x;
char s[11];
scanf("%d ", &n);
while(n--) {
for(gets(s), a = 0, x = 1; s[a]; a++)
x *= s[a]-'0';
printf("%d\n", x);
}
return 0;
}
/**********************************************************************************/
/* Problem: a149 "乘乘樂" from */
/* Language: C */
/* Result: AC (2ms, 226KB) on ZeroJudge */
/* Author: morris1028 at 2011-08-03 17:35:04 */
/**********************************************************************************/
#include<stdio.h>
main() {
int a, n, x;
char s[11];
scanf("%d ", &n);
while(n--) {
for(gets(s), a = 0, x = 1; s[a]; a++)
x *= s[a]-'0';
printf("%d\n", x);
}
return 0;
}
下一篇:a202. 學長的鬼腳圖