水仙花数c/c++

[复制链接]
查看11 | 回复3 | 2016-10-17 18:43:27 | 显示全部楼层 |阅读模式
C++中水仙花数的实现:#include using namespace std;int main(){ int n; cout>n; int x,y,z; int sum1,sum2; cout #include int main (void) { long n,p; long c,a,j,s[30],i,q; p=0; a=10; scanf("%d",&n); q=n; for (i=1;c>10 ;++i) {
回复

使用道具 举报

千问 | 2016-10-17 18:43:27 | 显示全部楼层
#include#includeint main(){ int a,b,c,d,i; i=100; if(i<=999) {a=i/100;d=fmod(i,100);b=d/10;c=fmod(d,10);if(i=a*a*a+b*b*b+c*c*c)
回复

使用道具 举报

千问 | 2016-10-17 18:43:27 | 显示全部楼层
做了个3到8位的,你还可以自己扩展,请留下邮箱。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行