- 841 名前:デフォルトの名無しさん [2007/11/23(金) 01:48:36 ]
- 早速の回答、有難う御座います。
分かりにくい質問をいたしまして済みませんでした。 課題を以下に貼り付けます。 public class searcfh{ public static void main(String args[]){ int maxSize = 100; int [] arr; arr = new int[maxSize]; int nElems = 0; int count; int searchKey; arr[0] = 10;arr[1] = 13;arr[2] = 20;arr[3] = 89;arr[4] = 35; nElems = 5; for(count = 0; count < nElems; count ++){ System.out.print( arr[count] + " ");} System.out.println(""); searchKey = 20;for(count = 0; count < nElems; count ++){ if(arr[count] == searchKey){break;}} if(count == nElems){ System.out.println("Can't find " + searchKey);} else{System.out.println("Found " + searchKey);} }} 分かりにくい質問をして済みませんでした。 このソースに加える形でお願いできますでしょうか。 よろしくお願いします。
|

|