首页 > 分享 > c语言;水仙花数程序

c语言;水仙花数程序

#include<stdio.h> #include<stdlib.h> #include<math.h> int main() { int i=0; int count=0; int num=0; int tmp=0; scanf_s("%d",&i) if(i!=0); { while(i) { count++; i=/10; } printf(“%d位数 n",count); } else { printf("1 位数n"); } while(i/10) { tmp+=pow(i%10,count); i=i/10; } if(tmp=1) { printf("水仙花数n"); } system("pause"); return 0;

12345678910111213141516171819202122232425262728293031323334

相关知识

C语言:输出所有的水仙花数
vs水仙花数c语言代码,求水仙花数c语言代码怎么写
C语言编写水仙花数
C语言:PAT练习:水仙花数( T & F)
1028: 判断水仙花数(C语言)
水仙花数C语言代码优化
水仙花数,C语言
【C语言】求水仙花数(完整代码)
C语言判断水仙花数
C语言入门:判断水仙花数(100~999)

网址: c语言;水仙花数程序 https://m.huajiangbk.com/newsview501830.html

所属分类:花卉
上一篇: 种植+经营+绿化工程 新模式让新
下一篇: R语言的apply族函数