全WA求助!
查看原帖
全WA求助!
1385836
interory楼主2024/11/10 12:11
#include <iostream>
using namespace std;
#define int long long
int arr[15];
signed main(){
    int a,b=1,c,d=1,e;
    cin>>a;
    memset(arr,0,sizeof(arr));
    for(int i=1;i<=a;i++){
        int temp=1,num=0;
        cin>>b>>e;
    	for(int j=1;j<=b;j++){
    		temp=temp*j; 
		}
        while(temp>0){
            c=temp%10;
            if(c==e){
                num++;
            }
            temp=temp/10;
        }
        arr[i]=num;
    }
    for(int i=1;i<=a;i++){
        cout<<arr[i]<<endl;
    }
    return 0;
}
2024/11/10 12:11
加载中...