本帖最后由 bw126 于 2011-03-06 15:23:54 编辑

解决方案 »

  1.   


    import java.util.*;public class Test
    {
    public static void main(String[] args)
    {
    int[][] procedure = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};

    for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
    {
    if (procedure[i][j] > 7)
    System.out.println("Value found was \"" + procedure[i][j] + "\" at [" + i + "][" + j + "]");
    }
    }
    }
      

  2.   

    import java.util.*;public class Test
    {
    public static void main(String[] args)
    {
    Scanner in = new Scanner(System.in);
    System.out.print("请输入最大数:");
    int maxValue = in.nextInt();
    System.out.print("请输入最小数:");
    int minValue = in.nextInt();
    System.out.print("请输入一个数:");
    double tmp = in.nextDouble();
    while (tmp < minValue || tmp > maxValue)
    {
    System.out.print("请输入一个数:");
    tmp = in.nextDouble();
    }
    System.out.println(tmp);
    }
    }
      

  3.   


    谢谢你,可以实现找到数据和位置了。
    不过如果要求可以输入数组是怎么样呢?好象是有个SCANNER之类的东西?其实我也觉得老师很奇怪,什么都没有教就上了一节课,这样的代码就要我们搞定,老外的要求真的是高啊?难道是摸底测试?再次谢谢你的回复。