#include<iostream>
using namespace std;
int f1(int n)
{
if(n%11==0)return 1;
return 0;
}
int f2(int n)
{
int t=n,s=0;
while(t!=0)
{
s+=t%10;
t/=10;
}
if(s==13)return 1;
return 0;
}
void show(int n=0) //给函数赋了初始值
{
int count=0; //count为计数器
for(;n<1000;n++){
if(f1(n)&&f2(n))
{
cout<<n<<'\t';
count++;
if(count%5==0) //按每行5个输出
cout<<'\n';
}
}cout<<"\n共有"<<count<<"个数满足条件。"<<endl;
}
int main()
{
int n;
cout<<"小于1000的自然数,能被11整除且各位数字之和为13的数有:\n";
show(n);
return 0;
}