提交时间:2025-07-16 21:40:37
运行 ID: 333892
#include<bits/stdc++.h> using namespace std; int main(){ int n,t,s,c=0; cin>>n; //列举所有可能的情况 for(int i=1; i<=n; i++){ //验证符合题目要求 //数字之和为13 s=0; t=i; while(t>0){ s+=t%10; t=t/10; } if(s==13){ c++; } } cout<<c; return 0; }