首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
williams
2024年3月10日 22:48
水仙花数 题解:
P1034
回复 3
|
赞 15
|
浏览 1.6k
#include <stdio.h> int main() { int m, n; while (scanf("%d %d", &m, &n) != EOF) { if (m == 0 && n == 0) break; int flag = 0; for (int i = m; i <= n; i++) { int num = i; int sum = 0; int digit...
zhangan
2024年3月6日 16:57
水仙花数 题解:
P1034
回复 0
|
赞 6
|
浏览 895
#include <stdio.h> #include <math.h> // 检查是否为水仙花数 int isShuixianhua(int num) { int sum = 0; int originalNum = num; while (num > 0) { int digit = num % 10; sum += pow(digit,...
小王桐学
2024年1月27日 22:42
水仙花数 题解:C
P1034
回复 0
|
赞 12
|
浏览 1.4k
#include <stdio.h> int DaffodilNum(int n) { int a,b,c; a = n%10; b = n/10%10; c = n/100; if(a*a*a+b*b*b+c*c*c == n) return 1; else return 0; } int main() { int m,n,i,flag; while (scanf("%d %d",&m,&n) != EOF) { flag = 0; if(m == 0 && n ==...
carrot_huan
2024年1月19日 14:34
水仙花数 题解:C
P1034
回复 0
|
赞 2
|
浏览 940
#include<stdio.h> #include<math.h> int Judge(int x) { int temp = x; if ((int)pow(x / 100, 3) + (int)pow(x % 100 / 10, 3) + (int)pow(x % 10, 3) == temp)return 1; return 0; } int main() { int m, ...
活着的传奇
2023年8月25日 11:01
水仙花数 题解:
P1034
回复 0
|
赞 6
|
浏览 1.7k
注意输入输出格式问题,换行和输入不为 #include<bits/stdc++.h> using namespace std; int shuixianhua(int i){ int a,b,c; c=i%10; b=(i/10)%10; a=i/100; if(i==c*c*c+b*b*b+a*a*a) return 1; else return 0; } int main(){ int m,n; cin>>m>>n; while(!(m==0&&n==0)){ int d=...
Syou
2023年8月16日 14:59
水仙花数 题解:
P1034
回复 0
|
赞 0
|
浏览 1.4k
C++ 感觉写的好复杂啊aaa #include <iostream> #include <string> #include <math.h> #include <vector> using namespace std; vector<int> fun(int m, int n){ vector<int> res; for(int num = m; num < n; num++){ string numS = to_string(num); ...
Hegel
2023年3月18日 20:31
水仙花数,各位的三次方之和为它本身
P1034
回复 0
|
赞 3
|
浏览 3.5k
#include <iostream> using namespace std; int main() { int m,n; cin>>m>>n; while(!(m==0&&n==0)){ int flag=0; for(m;m<=n;m++){ int t = m,sum =0; while(t>0){ sum+=(t%10)*(t%10)*(t%10); t/=10; } if(m==sum){ cout<<m&l...
sincerely_LM
2021年2月23日 17:21
题本本身不难,就是输出格式上需要注意
P1034
回复 0
|
赞 2
|
浏览 9.1k
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> int main(int argc, char const *argv[]) { bool found; int m,n,flag; while(scanf("%d %d",&m,&n)){ flag = 0 ;//初始化,flag,found found = false ; if(n==0){ ...
dengfenglai
2021年2月3日 23:24
Python过不了,找不到原因
P1034
回复 0
|
赞 0
|
浏览 7.4k
# 输入数据有多组,每组占一行,包括两个整数m和n(100<=m<=n<=999), # .输入为0 0时表示输入数据结束(不需要输出)。 tag=0 def isflower(i): a=i//100 b=i//10%10 c=i%10 if pow(a,3)+pow(b,3)+pow(c,3)==i: return True else: return False while 1: a,b=map(int,input().split()) if a==...
hijack
2020年7月14日 20:02
1034水仙花数 (*^-^*)
P1034
回复 0
|
赞 3
|
浏览 12.7k
//注释应该可以看懂,欢迎大家一起交流。 //1034水仙花数 (*^-^*) #include<iostream> #include<cmath> using namespace std; bool judgeNarciNum(int num); int main() { int m, n; while(cin >> m >> n,m != 0 && n!= 0) { int flag = 0;//表示(m,n)区间是否有水仙花数 for(int i = m; i &l...
1
2
3
题目
水仙花数
题解数量
26
发布题解
在线答疑
热门题解
1
水仙花数 题解:
2
水仙花数 题解:
3
水仙花数 题解:
4
水仙花数 题解:
5
水仙花数 题解:
6
水仙花数 题解:
7
水仙花数 题解:C
8
水仙花数 题解:
9
水仙花数 题解:优美
10
水仙花数 题解: