四位玫瑰数 描述 四位玫瑰数是4位数的自幂数.自幂数是指一个 n 位数,它的每个位上的数字的 n 次幂之和等于它本身.
python求100以内素数之和 from math import sqrt # 使用isPrime函数 def isPrime(n): if n <= 1: return False for i in range(2, int(sqrt(n)) + 1): if n % i == 0: return False return True count = 0 for i in range(101): if isPrime(i): count += i print(count) # 单行程序扫描素数
源代码: package 数组;import java.util.*;public class vvv { public static void main(String[] args) { Scanner s = new Scanner(System.in); int[] x = new int[10]; System.out.println("请输入长度为10的数组:"); for (int i = 0; i < 10; i++) { x[i] = s.nextInt(); }
一.程序编写 import java.util.*;public class Port { public static void main(String[] args) { // TODO 自动生成的方法存根 int a[]=new int[10]; Scanner d=new Scanner(System.in); System.out.println("输入十个整数:"); for(int i= 0; i < a.length; i++) a[i]=d.nex