摘要:1 //使用Eratoshene滤网来生成2~1000之间的素数。 2 import acm.program.*; 3 public class Eratosthene extends ConsoleProgram { 4 public void run(){ 5 prime = new int[999]; 6 for(int i = 0; i < 999; i++) { 7 prime[i] = i + 2; 8 } 9 int j = 0;10 int num =0;11 ...
阅读全文
摘要://读入7名裁判所打的分数,计算去掉最高分和最低分之后剩余的5个分数的平均值。import acm.program.*;public class score extends ConsoleProgram{ public void run(){ score = new int[NUM]; int sum = 0; double average = 0; for (int i = 0; i < NUM; i++) { score[i] = readInt("Input the score " + i + " : "...
阅读全文
摘要:Google 的查询参数变量值说明q或者as_q搜索查询搜索查询as_eq搜索关键字将从搜索中排除的关键字start0 到最大结果数用于显示结果页面。结果0是第一页结果页面的第一个结果num maxResults1到100每页所显示的结果数filter0或1如果filter为0,则显示可能重复的结果restrict限定代码限定位于某个特定的国家的结果hl语言代码这个参数描述了Google用来显示结果所用的语言。可以设为你的母语。查找到的页面未经过翻译lr语言代码语言限定。仅显示该种语言的页面ieUTF-8Web搜索的输入编码。Google建议使用UTF-8oeUTF-8Web搜索的输出编码。G
阅读全文