首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
苍灵
2025年6月23日 13:55
水仙花数 题解:C++
P1034
回复 0
|
赞 2
|
浏览 276
#include<bits/stdc++.h> using namespace std; int sumG(int a){ int sum=0; while(a!=0){ sum=sum+pow(a%10,3); a=a/10; } return sum; } int main(){ int m,n; while(cin>>m>>n&&(m!=0&&n!=0)){ bool flag=false; for(int i=m;i<=n;i++){ ...
leo110
2025年5月13日 20:29
水仙花数 题解:
P1034
回复 0
|
赞 0
|
浏览 292
#include<iostream> #include<cmath> using namespace std; int flag=0; void narcissus(int n){ int tmp=n,ans(0); while(tmp){ ans+=pow((tmp%10),3); tmp/=10; ...
西电机试专家
2025年3月25日 16:14
水仙花数 题解:优美
P1034
回复 0
|
赞 8
|
浏览 572
#include <bits/stdc++.h> using namespace std; int sxh(int x){ int ge=x%10; int shi=x/10%10; int bai=x/100%10; return ge*ge*ge+shi*shi*shi+bai*bai*bai; } int main(){ int a,b; ...
jaygee_
2025年3月12日 17:41
水仙花数 题解:
P1034
回复 0
|
赞 18
|
浏览 816
#include<bits/stdc++.h> using namespace std; int main() { int m, n; while(cin >> m >> n) { if(m == 0 && n == 0) break; int flag = 0; for(int i = m; i <= n; i++) { int temp = i; int h = temp / 100; int s = temp / 10 % 10; int g = temp...
jisuanji111
2025年2月18日 15:02
水仙花数 题解:
P1034
回复 0
|
赞 25
|
浏览 979
#include <bits/stdc++.h> using namespace std; int main(){ int m,n; while (cin >> m >> n){ if (m == 0 && n == 0) break; ...
Laaaaaaaaa09
2025年1月26日 14:45
水仙花数 题解:
P1034
回复 0
|
赞 10
|
浏览 1.5k
#include <bits/stdc++.h> using namespace std; int main(){ int a,n,m,count=0,num=0; int n1=0,n2=0,n3=0; while(1){ cin >> m &...
海的那边
2025年1月22日 19:53
水仙花数 题解:
P1034
回复 0
|
赞 13
|
浏览 815
#include<bits/stdc++.h> //#include <stdio.h> //#include <stdbool.h> // 判断一个数是否为水仙花数 bool isNarcissistic(int num) { int hundreds = num / 100; int tens = (num / 10) % 10; int ones = num % 10; return num == hundreds ...
Candour
2024年4月25日 23:31
水仙花数 题解:
P1034
回复 1
|
赞 13
|
浏览 1.6k
#include <bits/stdc++.h> using namespace std; int n, m; bool cheak(int x) { int a = x / 100; int b = (x / 10) % 10; int c = x % 10; return a * a * a + b * b * b + c * c * c == x; } int main() { while(cin >> n >> m, n, m) { bool t = true; fo...
lingdongyang
2024年3月21日 20:22
水仙花数 题解:
P1034
回复 0
|
赞 58
|
浏览 2.5k
#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 s1 = 0;//个位 int s2 = 0;//十位 int s3 = 0;//百位 s1 = i % 10; s2 ...
小酒
2024年3月15日 22:12
水仙花数 题解:
P1034
回复 0
|
赞 5
|
浏览 1.1k
1034解题思路 #include <bits/stdc++.h> using namespace std; int main() { int n,m; while(cin>>n>>m) { int l1=0,l2=0,l3=0; int flag=0; int y=0; if(n==0&&m==0) break; for(int i=n;i<=m;i++) { l1=i%10; y=i...
1
2
3
题目
水仙花数
题解数量
26
发布题解
在线答疑
热门题解
1
水仙花数 题解:
2
水仙花数 题解:
3
水仙花数 题解:
4
水仙花数 题解:
5
水仙花数 题解:
6
水仙花数 题解:
7
水仙花数 题解:C
8
水仙花数 题解:
9
水仙花数 题解:优美
10
水仙花数 题解: