题目:打印出所有的“水仙花数”,所谓“水仙花数”是指一个三位数,其各位数字立方和等于该数

来源:百度知道 编辑:UC知道 时间:2024/05/16 06:27:11

#include"stdio.h"
main()
{
int i,a,b,c,d,
for(i=100;i<=999;i++)
{
a=i/100;b=(i-a*100)/10;c=i%10;
if(i=a*a*a+b*b*b+c*c*c)
printf("%d,",i);
}

main()
{
int score;
char grade;
printf("please input a score\n");
scanf("%d",&score);
grade=score>=90?'A':(score>=60?'B':'C');
printf("%d belongs to %c",score,grade);
}

#include<iostream>
using namespace std;
int main(){
for(int i=100,b,temp; i<1000; i++)
b=0;
temp=i/100;
b+=temp*temp*temp;
temp=i%100/10;
b+=temp*temp*temp;
temp=i%10;
b+=temp*temp*temp;
if(i==b)
cout<<i<<endl;
}

main()
{int c,c1,c2,c3;
printf("'water flower'number is:");
for(c=100;c<1000;c++)
{c1=c/1

题目:打印出所有的“水仙花数”,所谓“水仙花数”是指一个三位数,其各位数字立方和等于该数 求个c语言答案,打印出所有的“水仙花数”。水仙花数是一个三位数,其各位数字的立方和等于该数本身, C语言 打印出所有的“水仙花数”,所谓“水仙花数”是指一个3位数,其各位数字立方和等于该数本身。 打印出所有的“水仙花数”,所谓“水仙花数”是指一个三位数,其各位数字立方和等于该数本身。 打印出1000以内的水仙花数(编程) 编写程序打印出最大的水仙花数 求助一个JAVA程序实例,“编制程序,打印出100—10000中所有的”水仙花数“” c++编程打印出水仙花数 急征<编写程序打印出最大的水仙花数> 编程求出所有的 “水仙花数”: