1 solutions

  • 0
    @ 2023-1-16 10:01:05
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n, s = 0, c = 0;
    	cin >> n;
    	for (int i = 1; i <= n; i++){
    		s = 0;
    		int t = i;
    		while(t != 0){
    			s = s + t % 10;
    			t /= 10;
    		}
    		if (s == 13){
    			c++;
    		}
    	}
    	cout << c << endl;
    	return 0;
    }
    
    
    
    • 1

    Information

    ID
    848
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    # Submissions
    6
    Accepted
    2
    Uploaded By