#8471: WA輸出短少 問題


crazytim (天邊)

學校 : 臺北市立成功高級中學
編號 : 35518
來源 : [140.112.174.201]
最後登入時間 :
2025-07-05 11:52:35

WA (line:6)
輸出短少
您共輸出 5 行。 
我用陣列作的,不知道是不是gets()那部分的問題?? 
 
#include <iostream>
#include <string.h>
using namespace std;

int main()
{
int t,s;
char a[10];
char T[10];
cin>>t;
gets(T);
while(t--)
{
gets(a);
s=1;
for(int i=0;i<strlen(a);i++)
s=s*(a[i]-48);
cout<<s<<"\n";
}

    return 0;
}