题目链接:Codeforces 417E Square Table 题目大意:给出n和m.要求给出一个矩阵,要求每一列每一行的元素的平方总和是一个平方数. 解题思路:构造.依照 a a a b a a a b a a a b c c c d 的方式取构造,然后a,b,c,d的值用随机生成数去枚举,只是我认为用暴力也是能够的. #include <cstdio> #include <cstring> #include <cmath> #include <cstdli
package day01; import java.util.Arrays; import java.util.Random; public class MaxOfArray { public static void main(String[] args) { int[] arr = new int[10]; Random ran = new Random(); //随机生成数 for(int i = 0;i<=9;i++) { arr[i] = ran.nextInt(100); } Sys
<script> // 封装一个随机生成数字的函数 function random(a, b) { var n = Math.round(Math.random() * (a - b) + b); return n; } //=====================================有漏洞版============================================= function getCode(){ //定义一个字符串把所有可能都装进去,全部字母以及数字