1 條題解

  • 1
    @ 2025-7-11 11:13:46
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,m,k=0;
    	cin>>n>>m;
    	for(int i=1;i<=n;i++){
    		int t=i;
    		while(t){
    			if(t%10==m){
    				k++;
    			}
                t/=10;
    		}
    	}
    	cout<<k;
    	return 0;
    }
    
    

    資訊

    ID
    2847
    時間
    1000ms
    記憶體
    128MiB
    難度
    1
    標籤
    遞交數
    48
    已透過
    28
    上傳者