Assignment2_FindRange
来源:互联网 发布:linux 挂载大硬盘 编辑:程序博客网 时间:2024/06/05 14:48
/*
* File: FindRange.java
* --------------------
* This program is a stub for the FindRange problem, which finds the
* smallest and largest values in a list of integers.
*/
import acm.program.*;
public class FindRange extends ConsoleProgram {
/* define your constants here. (like your SENTINEL value) */
public void run() {
// You fill this in
println("This program finds the largest and smallest numbers.");
int a = readInt("?");
int min = a, max = a;
while (a != 0) {
if (a > max)
max = a;
if (a < min)
min = a;
a = readInt("?");
}
println("smallest: " + min);
println("largest: " + max);
}
}
* File: FindRange.java
* --------------------
* This program is a stub for the FindRange problem, which finds the
* smallest and largest values in a list of integers.
*/
import acm.program.*;
public class FindRange extends ConsoleProgram {
/* define your constants here. (like your SENTINEL value) */
public void run() {
// You fill this in
println("This program finds the largest and smallest numbers.");
int a = readInt("?");
int min = a, max = a;
while (a != 0) {
if (a > max)
max = a;
if (a < min)
min = a;
a = readInt("?");
}
println("smallest: " + min);
println("largest: " + max);
}
}
- Assignment2_FindRange
- MiniGUI1.6.8与1.3.3的一些不同
- HDU 1198 Farm Irrigation
- 几个重量级的NoSQL数据库和管理工具
- PHP PDO总结
- java_集合
- Assignment2_FindRange
- 简单的MiniGUI软键盘
- js 构造函数与原型模式
- poj 1094 Sorting It All Out(拓扑排序)
- Computer aided analysis of dynamic contrast enhanced MRI of breast cancer/ Yaniv Gal.
- 2012年九月六号阿里巴巴面试
- 小提琴A大调
- 播放minimad的解码声音
- 设计模式---装饰器模式