怎么把输出的370 371,输出为水仙花的个数为2个

#include
#include
using namespace std;
int main()
{
int x,m,n,a,b,c,d,e;
cin>>m>>n;
if(m>=100&&n<=999&&m<=n)
{
int cnt=0;
for(x=m;x<=n;x++)
{
a=x%10;
b=x/10;
c=b%10;
d=b/10;
e=aaa+ddd+ccc;
if(x==e)
{
cnt++;
cout<<x<<'\t';
}
}
if(cnt==0)
cout<<"no";
cout<<endl;
}
return 0;
}

记录 一下水仙花数的个数就可以,如有帮助,希望采纳。

#include
#include
using namespace std;
int main()
{
int x,m,n,a,b,c,d,e;
cin>>m>>n;
if(m>=100&&n<=999&&m<=n)
{
int cnt=0;
for(x=m;x<=n;x++)
{
a=x%10;
b=x/10;
c=b%10;
d=b/10;
e=aaa+ddd+ccc;
if(x==e)
{
cnt++;
cout<<x<<'\t';
}
}
if(cnt==0)
cout<<"no";
else
  cout<<"水仙花的个数: "<<cnt;
cout<<endl;
}
return 0;
}

增加cout<<"水仙花的个数: "<<cnt;增加这行代码,如有帮助,希望采纳。