//判断100--999之前的水仙花数.水仙花数举例:153=13+53+33. using System;public class Program { public static void Main() { int a,b,c,d,e; for(int num=100;num<=999;num++) { a=num%10;//得到个位数字 c=num/10%10;//…
//7.求两个整数的最大公约数#include<stdio.h>//用穷举法求出最大公约数int gcd1(int m,int n){ int min = m > n ? n : m; while (min) { if (m%min == 0 && n%min == 0) { break; } else { min--; } } return min;}//快速求最大公约数的算法,称为辗转相除法,以下用递归实现int gcd2(int m,int n){ if (n==0…
//你们的鼓励是我最大的动力 大家可以多留言评论 在接下来很长一段时间我会从初级到高级每天更新 大家有想学习的内容也可以留言哦 //现在是我做C#老师的第28天,希望和大家一起努力 加油 using System; using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks; namespace FOR{ class Program { static void…
#include <stdio.h> int fun(int x) { int a, b, c; a = x / ; b = x % / ; c = x % ; if (x == a * a * a + b * b * b + c * c * c) ; else ; } int main() { int m; printf("1000以内的水仙花数:\n"); ; m < ; m++) { ) printf("%5d\n", m); } }…