题目:判断101-200之间有多少个素数,并输出所有素数. 思路:判断素数的方法:用一个数分别去除2到sqrt(这个数),如果能被整除,则表明此数不是素数,反之是素数. 具体代码: public Vector exp(int first, int end) { Vector v = new Vector(); boolean b; for (int i = first; i <= end; i++) { b = true;// 假设是质数 for (int j = 2; j < i; j++)…
题目 /*You are a professional robber planning to rob houses along a street. * Each house has a certain amount of money stashed, * the only constraint stopping you from robbing each of them is that * adjacent houses have security system connected and *…