質問編集履歴
5
誤りを訂正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -334,9 +334,9 @@
|
|
334
334
|
|
335
335
|
}
|
336
336
|
|
337
|
-
if(br
|
337
|
+
if(brC != null){
|
338
|
-
|
338
|
+
|
339
|
-
br
|
339
|
+
brC.close();
|
340
340
|
|
341
341
|
}
|
342
342
|
|
4
現時点のソースコードと問題点を修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,23 +8,15 @@
|
|
8
8
|
|
9
9
|
【問題点】
|
10
10
|
|
11
|
-
①数値化出来るかどうかをisHanNum(String s)メソッドを使用
|
12
|
-
|
13
|
-
したいのですが、配列の要素だと型の不一致でコンパイル
|
14
|
-
|
15
|
-
出来ません。
|
16
|
-
|
17
|
-
②除算した結果を偶数か奇数で判断したいのですが。int同士だと
|
18
|
-
|
19
|
-
|
11
|
+
①出力結果が2回づつ表示されています。
|
20
|
-
|
12
|
+
|
21
|
-
|
13
|
+
②inM.csvファイルが空の場合エラー表示して通常終了したい
|
22
14
|
|
23
15
|
のですが次の処理に進んでしまいます。
|
24
16
|
|
25
17
|
|
26
18
|
|
27
|
-
以上
|
19
|
+
以上2点の解決方法をお教えいただけないでしょうか。
|
28
20
|
|
29
21
|
|
30
22
|
|
@@ -136,465 +128,473 @@
|
|
136
128
|
|
137
129
|
|
138
130
|
|
139
|
-
public class JudgmentValue {
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
131
|
+
public class JudgementValue {
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
public static void main(String[] args) {
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
BufferedReader brA = null; //inA Inputファイル入力用
|
140
|
+
|
141
|
+
BufferedReader brC = null; //inC 計算ファイル入力用
|
142
|
+
|
143
|
+
BufferedReader brM = null; //inM 判定マスタファイル入力用
|
144
|
+
|
145
|
+
BufferedWriter bwA = null ; //outAファイル出力用
|
146
|
+
|
147
|
+
BufferedWriter bwB = null ; //outBファイル出力用
|
148
|
+
|
149
|
+
String stA = ""; //inAファイルデータを格納
|
150
|
+
|
151
|
+
String stC = ""; //inCファイルデータを格納
|
152
|
+
|
153
|
+
String stM = ""; //inMファイルデータを格納
|
154
|
+
|
155
|
+
ArrayList<String[]> alMaster = new ArrayList<String[]>(); //判定マスタ
|
156
|
+
|
157
|
+
ArrayList<String[]> alCalc = new ArrayList<String[]>(); //計算C
|
158
|
+
|
159
|
+
String[][] masterM = null ; //判定マスタ用
|
160
|
+
|
161
|
+
String[][] numC = null ; //計算C用
|
162
|
+
|
163
|
+
double quotient = 0; //除算の商い結果
|
164
|
+
|
165
|
+
boolean emptyflgM = true; //inM判定マスタファイル空判定フラグ
|
166
|
+
|
167
|
+
boolean emptyflgC = true; //inC計算Cファイル空判定フラグ
|
168
|
+
|
169
|
+
boolean emptyflgA= true; //inA入力ファイル空判定フラグ
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
try{
|
174
|
+
|
175
|
+
brC = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Users/temp/Desktop/inC.csv"),"JISAutoDetect"));
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
}catch(FileNotFoundException e){
|
180
|
+
|
181
|
+
System.err.println("inC.csvファイルが見つかりません。");
|
182
|
+
|
183
|
+
} catch (UnsupportedEncodingException e) {
|
184
|
+
|
185
|
+
e.printStackTrace();
|
186
|
+
|
187
|
+
}
|
188
|
+
|
189
|
+
try{
|
190
|
+
|
191
|
+
brM = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Users/temp/Desktop/inM.csv"),"JISAutoDetect"));
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
}catch(FileNotFoundException e){
|
196
|
+
|
197
|
+
System.err.println("inM.csvファイルが見つかりません。");
|
198
|
+
|
199
|
+
}catch (UnsupportedEncodingException e) {
|
200
|
+
|
201
|
+
e.printStackTrace();
|
202
|
+
|
203
|
+
}
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
fileError1:
|
208
|
+
|
209
|
+
//inMファイルデータを読み込み
|
210
|
+
|
211
|
+
try {
|
212
|
+
|
213
|
+
while((stM = brM.readLine()) != null){
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
emptyflgM = false;
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
if(stM.equals("")){
|
222
|
+
|
223
|
+
System.err.println("データに不備があります。");
|
224
|
+
|
225
|
+
break fileError1;
|
226
|
+
|
227
|
+
}
|
228
|
+
|
229
|
+
alMaster.add(stM.split(",")); /* ArrayListへ読み込み */
|
230
|
+
|
231
|
+
}
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
if(emptyflgM){
|
236
|
+
|
237
|
+
System.err.println("inM.csvファイルは空です。");
|
238
|
+
|
239
|
+
break fileError1;
|
240
|
+
|
241
|
+
}
|
242
|
+
|
243
|
+
masterM = new String[alMaster.size()][];
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
for (int i = 0; i < alMaster.size(); i++) {
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
masterM[i] = alMaster.get(i); /* ArrayListから配列へ格納 */
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
//inCファイルデータを読み込み
|
260
|
+
|
261
|
+
while((stC = brC.readLine()) != null){
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
emptyflgC = false;
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
if(stC.equals("")){
|
270
|
+
|
271
|
+
System.err.println("データに不備があります。");
|
272
|
+
|
273
|
+
break fileError1;
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
alCalc.add(stC.split(",")); /* ArrayListへ読み込み */
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
if(emptyflgC){
|
286
|
+
|
287
|
+
System.err.println("inC.csvファイルは空です。");
|
288
|
+
|
289
|
+
break fileError1;
|
290
|
+
|
291
|
+
}
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
numC = new String[alCalc.size()][];
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
for (int i = 0; i < alCalc.size(); i++) {
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
numC[i] = alCalc.get(i); /* ArrayListから配列へ格納 */
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
if (!isHanNum(numC[i][0]) || !isHanNum(numC[i][1])) {
|
308
|
+
|
309
|
+
System.err.println("数値以外のものが含まれています。");
|
310
|
+
|
311
|
+
break fileError1;
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
}
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
} catch(IOException e){
|
322
|
+
|
323
|
+
System.err.println("エラーが発生しました。");
|
324
|
+
|
325
|
+
e.printStackTrace();
|
326
|
+
|
327
|
+
}finally{
|
328
|
+
|
329
|
+
try {
|
330
|
+
|
331
|
+
if(brM != null){
|
332
|
+
|
333
|
+
brM.close();
|
334
|
+
|
335
|
+
}
|
336
|
+
|
337
|
+
if(brA != null){
|
338
|
+
|
339
|
+
brA.close();
|
340
|
+
|
341
|
+
}
|
342
|
+
|
343
|
+
}catch (IOException e) {
|
344
|
+
|
345
|
+
// TODO 自動生成された catch ブロック
|
346
|
+
|
347
|
+
e.printStackTrace();
|
348
|
+
|
349
|
+
}
|
350
|
+
|
351
|
+
}//finally
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
try{
|
356
|
+
|
357
|
+
brA = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Users/temp/Desktop/inA.csv"),"JISAutoDetect"));
|
358
|
+
|
359
|
+
}catch(FileNotFoundException e){
|
360
|
+
|
361
|
+
System.err.println("inA.csvファイルが見つかりません。");
|
362
|
+
|
363
|
+
}catch (UnsupportedEncodingException e) {
|
364
|
+
|
365
|
+
// TODO 自動生成された catch ブロック
|
366
|
+
|
367
|
+
e.printStackTrace();
|
368
|
+
|
369
|
+
}
|
370
|
+
|
371
|
+
try{
|
372
|
+
|
373
|
+
bwA = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:/Users/temp/Desktop/outA.csv"),"SJIS"));
|
374
|
+
|
375
|
+
}catch(FileNotFoundException e){
|
376
|
+
|
377
|
+
System.err.println("outA.csvファイルが見つかりません。");
|
378
|
+
|
379
|
+
}catch (UnsupportedEncodingException e) {
|
380
|
+
|
381
|
+
// TODO 自動生成された catch ブロック
|
382
|
+
|
383
|
+
e.printStackTrace();
|
384
|
+
|
385
|
+
}
|
386
|
+
|
387
|
+
try{
|
388
|
+
|
389
|
+
bwB = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:/Users/temp/Desktop/outB.csv"),"SJIS"));
|
390
|
+
|
391
|
+
}catch(FileNotFoundException e){
|
392
|
+
|
393
|
+
System.err.println("outB.csvファイルが見つかりません。");
|
394
|
+
|
395
|
+
}catch (UnsupportedEncodingException e) {
|
396
|
+
|
397
|
+
// TODO 自動生成された catch ブロック
|
398
|
+
|
399
|
+
e.printStackTrace();
|
400
|
+
|
401
|
+
}
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
fileError2:
|
406
|
+
|
407
|
+
try{
|
408
|
+
|
409
|
+
//inAファイルデータを読み込み
|
410
|
+
|
411
|
+
while((stA = brA.readLine()) != null){
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
emptyflgA = false;
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
if(stA.equals("")){
|
420
|
+
|
421
|
+
System.err.println("データに不備があります。");
|
422
|
+
|
423
|
+
break fileError2;
|
424
|
+
|
425
|
+
}
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
if(isHanNum(stA) == false){
|
430
|
+
|
431
|
+
System.err.println("数値以外のものが含まれています。");
|
432
|
+
|
433
|
+
break fileError2;
|
434
|
+
|
435
|
+
}
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
for (int i = 0; i < numC.length; i++) {
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
if(stA.equals(numC[i][0])){ //入力の値と計算Cのキーの値の一致確認
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
quotient= Double.valueOf(stA) / Double.valueOf(numC[i][1]);
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
if(quotient % 2 == 0){ //偶数かどうかを確認
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
if(masterM[1][1].equals("○")){
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
bwA.write(stA);
|
460
|
+
|
461
|
+
bwA.newLine();
|
462
|
+
|
463
|
+
System.out.println("1番目:" + stA);
|
464
|
+
|
465
|
+
}else{
|
466
|
+
|
467
|
+
bwB.write(stA);
|
468
|
+
|
469
|
+
bwB.newLine();
|
470
|
+
|
471
|
+
System.out.println("2番目:" + stA);
|
472
|
+
|
473
|
+
}
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
}else{
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
if(masterM[0][1].equals("○")){
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
bwA.write(stA);
|
486
|
+
|
487
|
+
bwA.newLine();
|
488
|
+
|
489
|
+
System.out.println("3番目:" + stA);
|
490
|
+
|
491
|
+
}else{
|
492
|
+
|
493
|
+
bwB.write(stA);
|
494
|
+
|
495
|
+
bwB.newLine();
|
496
|
+
|
497
|
+
System.out.println("4番目:" + stA);
|
498
|
+
|
499
|
+
}
|
500
|
+
|
501
|
+
}
|
502
|
+
|
503
|
+
}
|
504
|
+
|
505
|
+
} //for
|
506
|
+
|
507
|
+
quotient = 0; //除算の商い結果を0にリセット
|
508
|
+
|
509
|
+
} //while
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
if(emptyflgA){
|
514
|
+
|
515
|
+
System.err.println("inA.csvファイルは空です。");
|
516
|
+
|
517
|
+
break fileError2;
|
518
|
+
|
519
|
+
}
|
520
|
+
|
521
|
+
|
522
|
+
|
523
|
+
}catch(IOException e){
|
524
|
+
|
525
|
+
System.err.println("エラーが発生しました。");
|
526
|
+
|
527
|
+
e.printStackTrace();
|
528
|
+
|
529
|
+
}finally{
|
530
|
+
|
531
|
+
try {
|
532
|
+
|
533
|
+
if(brA != null){
|
534
|
+
|
535
|
+
brA.close();
|
536
|
+
|
537
|
+
}
|
538
|
+
|
539
|
+
if(bwA != null){
|
540
|
+
|
541
|
+
bwA.close();
|
542
|
+
|
543
|
+
}
|
544
|
+
|
545
|
+
if(bwB != null){
|
546
|
+
|
547
|
+
bwB.close();
|
548
|
+
|
549
|
+
}
|
550
|
+
|
551
|
+
}catch (IOException e) {
|
552
|
+
|
553
|
+
// TODO 自動生成された catch ブロック
|
554
|
+
|
555
|
+
e.printStackTrace();
|
556
|
+
|
557
|
+
}
|
558
|
+
|
559
|
+
}//finally
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
}//main
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
/**
|
570
|
+
|
571
|
+
* 半角数値チェック
|
572
|
+
|
573
|
+
* @param s 文字列
|
574
|
+
|
575
|
+
* @return true 正常 false エラー
|
576
|
+
|
577
|
+
*/
|
578
|
+
|
579
|
+
public static boolean isHanNum(String s){
|
580
|
+
|
581
|
+
try{
|
582
|
+
|
583
|
+
Double.parseDouble(s);
|
584
|
+
|
585
|
+
return true;
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
}catch(Exception e){
|
590
|
+
|
591
|
+
return false;
|
592
|
+
|
593
|
+
}
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
}
|
598
598
|
|
599
599
|
|
600
600
|
|
@@ -602,6 +602,4 @@
|
|
602
602
|
|
603
603
|
}
|
604
604
|
|
605
|
-
|
606
|
-
|
607
605
|
```
|
3
現時点の問題点を追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,27 @@
|
|
4
4
|
|
5
5
|
出力したいのですが、想定とおりに実装できません。
|
6
6
|
|
7
|
+
|
8
|
+
|
9
|
+
【問題点】
|
10
|
+
|
11
|
+
①数値化出来るかどうかをisHanNum(String s)メソッドを使用
|
12
|
+
|
13
|
+
したいのですが、配列の要素だと型の不一致でコンパイル
|
14
|
+
|
15
|
+
出来ません。
|
16
|
+
|
17
|
+
②除算した結果を偶数か奇数で判断したいのですが。int同士だと
|
18
|
+
|
19
|
+
小数点以下切り捨てなので、すべてが偶数になってしまいます。
|
20
|
+
|
21
|
+
③inM.csvファイルが空の場合エラー表示して通常終了したい
|
22
|
+
|
23
|
+
のですが次の処理に進んでしまいます。
|
24
|
+
|
25
|
+
|
26
|
+
|
7
|
-
|
27
|
+
以上3点の解決方法をお教えいただけないでしょうか。
|
8
28
|
|
9
29
|
|
10
30
|
|
@@ -32,14 +52,6 @@
|
|
32
52
|
|
33
53
|
|
34
54
|
|
35
|
-
現時点では、演算子 / は引数の型 BufferedReader, String[] で未定義ですのエラーが出ており
|
36
|
-
|
37
|
-
実装出来ておりません。
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
55
|
|
44
56
|
|
45
57
|
```ここに言語を入力
|
@@ -98,7 +110,7 @@
|
|
98
110
|
|
99
111
|
```ここに言語を入力
|
100
112
|
|
101
|
-
package
|
113
|
+
package test5;
|
102
114
|
|
103
115
|
|
104
116
|
|
@@ -130,8 +142,6 @@
|
|
130
142
|
|
131
143
|
public static void main(String[] args) {
|
132
144
|
|
133
|
-
// TODO 自動生成されたメソッド・スタブ
|
134
|
-
|
135
145
|
|
136
146
|
|
137
147
|
BufferedReader brA = null; //inA Inputファイル入力用
|
@@ -144,25 +154,27 @@
|
|
144
154
|
|
145
155
|
BufferedWriter bwB = null ; //outBファイル出力用
|
146
156
|
|
147
|
-
|
148
|
-
|
149
157
|
String stA = ""; //inAファイルデータを格納
|
150
158
|
|
151
159
|
String stC = ""; //inCファイルデータを格納
|
152
160
|
|
153
161
|
String stM = ""; //inMファイルデータを格納
|
154
162
|
|
155
|
-
|
156
|
-
|
157
|
-
ArrayList<String[]> alMaster = new ArrayList<String[]>();
|
163
|
+
ArrayList<String[]> alMaster = new ArrayList<String[]>(); //判定マスタ
|
158
|
-
|
164
|
+
|
159
|
-
ArrayList<String[]> alCalc = new ArrayList<String[]>();
|
165
|
+
ArrayList<String[]> alCalc = new ArrayList<String[]>(); //計算C
|
160
|
-
|
166
|
+
|
161
|
-
String[][] masterM ;
|
167
|
+
String[][] masterM = null ; //判定マスタ用
|
162
|
-
|
168
|
+
|
163
|
-
String[][] numC = null ;
|
169
|
+
String[][] numC = null ; //計算C用
|
164
|
-
|
170
|
+
|
165
|
-
int
|
171
|
+
int quotient = 0; //除算の商い結果
|
172
|
+
|
173
|
+
boolean emptyflgM = true; //inM判定マスタファイル空判定フラグ
|
174
|
+
|
175
|
+
boolean emptyflgC = true; //inC計算Cファイル空判定フラグ
|
176
|
+
|
177
|
+
boolean emptyflgA= true; //inA入力ファイル空判定フラグ
|
166
178
|
|
167
179
|
|
168
180
|
|
@@ -178,8 +190,6 @@
|
|
178
190
|
|
179
191
|
} catch (UnsupportedEncodingException e) {
|
180
192
|
|
181
|
-
// TODO 自動生成された catch ブロック
|
182
|
-
|
183
193
|
e.printStackTrace();
|
184
194
|
|
185
195
|
}
|
@@ -196,8 +206,6 @@
|
|
196
206
|
|
197
207
|
}catch (UnsupportedEncodingException e) {
|
198
208
|
|
199
|
-
// TODO 自動生成された catch ブロック
|
200
|
-
|
201
209
|
e.printStackTrace();
|
202
210
|
|
203
211
|
}
|
@@ -214,46 +222,58 @@
|
|
214
222
|
|
215
223
|
|
216
224
|
|
225
|
+
emptyflgM = false;
|
226
|
+
|
227
|
+
|
228
|
+
|
217
229
|
if(stM.equals("")){
|
218
230
|
|
219
231
|
System.err.println("データに不備があります。");
|
220
232
|
|
221
|
-
|
233
|
+
break fileError1;
|
222
234
|
|
223
235
|
}
|
224
236
|
|
225
|
-
|
226
|
-
|
227
237
|
alMaster.add(stM.split(",")); /* ArrayListへ読み込み */
|
228
238
|
|
229
|
-
|
239
|
+
}
|
240
|
+
|
241
|
+
|
242
|
+
|
230
|
-
|
243
|
+
if(emptyflgM){
|
244
|
+
|
245
|
+
System.err.println("inM.csvファイルは空です。");
|
246
|
+
|
247
|
+
break fileError1;
|
248
|
+
|
249
|
+
}
|
250
|
+
|
231
|
-
|
251
|
+
masterM = new String[alMaster.size()][];
|
232
|
-
|
233
|
-
|
234
|
-
|
252
|
+
|
253
|
+
|
254
|
+
|
235
|
-
|
255
|
+
for (int i = 0; i < alMaster.size(); i++) {
|
236
|
-
|
237
|
-
|
256
|
+
|
238
|
-
|
239
|
-
|
240
|
-
|
257
|
+
|
258
|
+
|
241
|
-
|
259
|
+
masterM[i] = alMaster.get(i); /* ArrayListから配列へ格納 */
|
242
|
-
|
243
|
-
|
244
|
-
|
260
|
+
|
245
|
-
|
261
|
+
}
|
246
|
-
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
247
|
-
|
267
|
+
//inCファイルデータを読み込み
|
248
|
-
|
249
|
-
}
|
250
|
-
|
251
|
-
|
252
268
|
|
253
269
|
while((stC = brC.readLine()) != null){
|
254
270
|
|
255
271
|
|
256
272
|
|
273
|
+
emptyflgC = false;
|
274
|
+
|
275
|
+
|
276
|
+
|
257
277
|
if(stC.equals("")){
|
258
278
|
|
259
279
|
System.err.println("データに不備があります。");
|
@@ -264,45 +284,243 @@
|
|
264
284
|
|
265
285
|
|
266
286
|
|
287
|
+
alCalc.add(stC.split(",")); /* ArrayListへ読み込み */
|
288
|
+
|
289
|
+
}
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
if(emptyflgC){
|
294
|
+
|
295
|
+
System.err.println("inC.csvファイルは空です。");
|
296
|
+
|
297
|
+
break fileError1;
|
298
|
+
|
299
|
+
}
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
numC = new String[alCalc.size()][];
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
for (int i = 0; i < alCalc.size(); i++) {
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
numC[i] = alCalc.get(i); /* ArrayListから配列へ格納 */
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
if(isHanNum(numC[i]) == false){
|
316
|
+
|
317
|
+
System.err.println("数値以外のものが含まれています。");
|
318
|
+
|
319
|
+
break fileError1;
|
320
|
+
|
321
|
+
}
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
}
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
} catch(IOException e){
|
330
|
+
|
331
|
+
System.err.println("エラーが発生しました。");
|
332
|
+
|
333
|
+
e.printStackTrace();
|
334
|
+
|
335
|
+
}finally{
|
336
|
+
|
337
|
+
try {
|
338
|
+
|
339
|
+
if(brM != null){
|
340
|
+
|
341
|
+
brM.close();
|
342
|
+
|
343
|
+
}
|
344
|
+
|
345
|
+
if(brA != null){
|
346
|
+
|
347
|
+
brA.close();
|
348
|
+
|
349
|
+
}
|
350
|
+
|
351
|
+
}catch (IOException e) {
|
352
|
+
|
353
|
+
// TODO 自動生成された catch ブロック
|
354
|
+
|
355
|
+
e.printStackTrace();
|
356
|
+
|
357
|
+
}
|
358
|
+
|
359
|
+
}//finally
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
try{
|
364
|
+
|
365
|
+
brA = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Users/temp/Desktop/inA.csv"),"JISAutoDetect"));
|
366
|
+
|
367
|
+
}catch(FileNotFoundException e){
|
368
|
+
|
369
|
+
System.err.println("inA.csvファイルが見つかりません。");
|
370
|
+
|
371
|
+
}catch (UnsupportedEncodingException e) {
|
372
|
+
|
373
|
+
// TODO 自動生成された catch ブロック
|
374
|
+
|
375
|
+
e.printStackTrace();
|
376
|
+
|
377
|
+
}
|
378
|
+
|
379
|
+
try{
|
380
|
+
|
381
|
+
bwA = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:/Users/temp/Desktop/outA.csv"),"SJIS"));
|
382
|
+
|
383
|
+
}catch(FileNotFoundException e){
|
384
|
+
|
385
|
+
System.err.println("outA.csvファイルが見つかりません。");
|
386
|
+
|
387
|
+
}catch (UnsupportedEncodingException e) {
|
388
|
+
|
389
|
+
// TODO 自動生成された catch ブロック
|
390
|
+
|
391
|
+
e.printStackTrace();
|
392
|
+
|
393
|
+
}
|
394
|
+
|
395
|
+
try{
|
396
|
+
|
397
|
+
bwB = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:/Users/temp/Desktop/outB.csv"),"SJIS"));
|
398
|
+
|
399
|
+
}catch(FileNotFoundException e){
|
400
|
+
|
401
|
+
System.err.println("outB.csvファイルが見つかりません。");
|
402
|
+
|
403
|
+
}catch (UnsupportedEncodingException e) {
|
404
|
+
|
405
|
+
// TODO 自動生成された catch ブロック
|
406
|
+
|
407
|
+
e.printStackTrace();
|
408
|
+
|
409
|
+
}
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
fileError2:
|
414
|
+
|
415
|
+
try{
|
416
|
+
|
417
|
+
//inAファイルデータを読み込み
|
418
|
+
|
419
|
+
while((stA = brA.readLine()) != null){
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
emptyflgA = false;
|
424
|
+
|
425
|
+
|
426
|
+
|
427
|
+
if(stA.equals("")){
|
428
|
+
|
429
|
+
System.err.println("データに不備があります。");
|
430
|
+
|
431
|
+
break fileError2;
|
432
|
+
|
433
|
+
}
|
434
|
+
|
435
|
+
|
436
|
+
|
267
|
-
if(isHanNum(st
|
437
|
+
if(isHanNum(stA) == false){
|
268
438
|
|
269
439
|
System.err.println("数値以外のものが含まれています。");
|
270
440
|
|
271
|
-
break fileError
|
441
|
+
break fileError2;
|
272
442
|
|
273
443
|
}
|
274
444
|
|
275
445
|
|
276
446
|
|
277
|
-
alCalc.add(stC.split(",")); /* ArrayListへ読み込み */
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
numC = new String[alCalc.size()][];
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
for (int i = 0; i <
|
447
|
+
for (int i = 0; i < numC.length; i++) {
|
286
|
-
|
448
|
+
|
449
|
+
|
450
|
+
|
287
|
-
f
|
451
|
+
if(stA.equals(numC[i][0])){ //入力の値と計算Cのキーの値の一致確認
|
288
|
-
|
289
|
-
|
290
|
-
|
452
|
+
|
453
|
+
|
454
|
+
|
291
|
-
|
455
|
+
quotient= Integer.valueOf(stA) / Integer.valueOf(numC[i][1]);
|
456
|
+
|
457
|
+
|
458
|
+
|
292
|
-
|
459
|
+
if(quotient % 2 == 0){ //偶数かどうかを確認
|
460
|
+
|
461
|
+
|
462
|
+
|
293
|
-
|
463
|
+
if(masterM[1][0].equals("○")){
|
464
|
+
|
465
|
+
|
466
|
+
|
294
|
-
|
467
|
+
bwA.write(stA);
|
468
|
+
|
469
|
+
bwA.newLine();
|
470
|
+
|
471
|
+
}else{
|
472
|
+
|
473
|
+
bwB.write(stA);
|
474
|
+
|
475
|
+
bwB.newLine();
|
476
|
+
|
295
|
-
|
477
|
+
}
|
478
|
+
|
479
|
+
|
480
|
+
|
296
|
-
|
481
|
+
}else{
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
if(masterM[0][0].equals("○")){
|
486
|
+
|
487
|
+
|
488
|
+
|
489
|
+
bwA.write(stA);
|
490
|
+
|
491
|
+
bwA.newLine();
|
492
|
+
|
493
|
+
}else{
|
494
|
+
|
495
|
+
bwB.write(stA);
|
496
|
+
|
497
|
+
bwB.newLine();
|
498
|
+
|
297
|
-
|
499
|
+
}
|
298
|
-
|
500
|
+
|
299
|
-
}
|
501
|
+
}
|
502
|
+
|
300
|
-
|
503
|
+
}
|
504
|
+
|
301
|
-
|
505
|
+
} //for
|
506
|
+
|
302
|
-
|
507
|
+
quotient = 0; //除算の商い結果を0にリセット
|
508
|
+
|
303
|
-
|
509
|
+
} //while
|
510
|
+
|
511
|
+
|
512
|
+
|
304
|
-
|
513
|
+
if(emptyflgA){
|
514
|
+
|
515
|
+
System.err.println("inA.csvファイルは空です。");
|
516
|
+
|
517
|
+
break fileError2;
|
518
|
+
|
519
|
+
}
|
520
|
+
|
521
|
+
|
522
|
+
|
305
|
-
}
|
523
|
+
}catch(IOException e){
|
306
524
|
|
307
525
|
System.err.println("エラーが発生しました。");
|
308
526
|
|
@@ -310,19 +528,25 @@
|
|
310
528
|
|
311
529
|
}finally{
|
312
530
|
|
313
|
-
|
531
|
+
try {
|
314
|
-
|
532
|
+
|
315
|
-
|
533
|
+
if(brA != null){
|
316
|
-
|
534
|
+
|
317
|
-
|
535
|
+
brA.close();
|
318
|
-
|
536
|
+
|
319
|
-
|
537
|
+
}
|
320
|
-
|
538
|
+
|
321
|
-
|
539
|
+
if(bwA != null){
|
322
|
-
|
540
|
+
|
323
|
-
|
541
|
+
bwA.close();
|
324
|
-
|
542
|
+
|
325
|
-
|
543
|
+
}
|
544
|
+
|
545
|
+
if(bwB != null){
|
546
|
+
|
547
|
+
bwB.close();
|
548
|
+
|
549
|
+
}
|
326
550
|
|
327
551
|
}catch (IOException e) {
|
328
552
|
|
@@ -332,223 +556,31 @@
|
|
332
556
|
|
333
557
|
}
|
334
558
|
|
335
|
-
|
559
|
+
}//finally
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
336
|
-
|
565
|
+
}//main
|
566
|
+
|
567
|
+
|
568
|
+
|
337
|
-
|
569
|
+
/**
|
570
|
+
|
338
|
-
|
571
|
+
* 半角数値チェック
|
572
|
+
|
339
|
-
|
573
|
+
* @param s 文字列
|
574
|
+
|
340
|
-
|
575
|
+
* @return true 正常 false エラー
|
576
|
+
|
341
|
-
|
577
|
+
*/
|
342
|
-
|
343
|
-
|
578
|
+
|
344
|
-
|
345
|
-
|
579
|
+
public static boolean isHanNum(String s){
|
346
|
-
|
347
|
-
System.err.println("inA.csvファイルが見つかりません。");
|
348
|
-
|
349
|
-
}catch (UnsupportedEncodingException e) {
|
350
|
-
|
351
|
-
// TODO 自動生成された catch ブロック
|
352
|
-
|
353
|
-
e.printStackTrace();
|
354
|
-
|
355
|
-
}
|
356
|
-
|
357
|
-
try{
|
358
|
-
|
359
|
-
bwA = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:/Users/temp/Desktop/outA.csv"),"SJIS"));
|
360
|
-
|
361
|
-
}catch(FileNotFoundException e){
|
362
|
-
|
363
|
-
System.err.println("outA.csvファイルが見つかりません。");
|
364
|
-
|
365
|
-
}catch (UnsupportedEncodingException e) {
|
366
|
-
|
367
|
-
// TODO 自動生成された catch ブロック
|
368
|
-
|
369
|
-
e.printStackTrace();
|
370
|
-
|
371
|
-
}
|
372
|
-
|
373
|
-
try{
|
374
|
-
|
375
|
-
bwB = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("C:/Users/temp/Desktop/outB.csv"),"SJIS"));
|
376
|
-
|
377
|
-
}catch(FileNotFoundException e){
|
378
|
-
|
379
|
-
System.err.println("outB.csvファイルが見つかりません。");
|
380
|
-
|
381
|
-
}catch (UnsupportedEncodingException e) {
|
382
|
-
|
383
|
-
// TODO 自動生成された catch ブロック
|
384
|
-
|
385
|
-
e.printStackTrace();
|
386
|
-
|
387
|
-
}
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
fileError2:
|
392
580
|
|
393
581
|
try{
|
394
582
|
|
395
|
-
//inAファイルデータを読み込み
|
396
|
-
|
397
|
-
while((stA = brA.readLine()) != null){
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
if(stA.equals("")){
|
402
|
-
|
403
|
-
System.err.println("データに不備があります。");
|
404
|
-
|
405
|
-
break fileError2;
|
406
|
-
|
407
|
-
}
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
if(isHanNum(stA) == false){
|
412
|
-
|
413
|
-
System.err.println("数値以外のものが含まれています。");
|
414
|
-
|
415
|
-
break fileError2;
|
416
|
-
|
417
|
-
}
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
for (int i = 0; i < numC.length; i++) {
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
if(stA.equals(numC[i])){
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
sum = brA / numC[i];
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
if(sum % 2 == 0){
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
if(masterM[1][0].equals("○")){
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
bwA.write(stA);
|
442
|
-
|
443
|
-
bwA.newLine();
|
444
|
-
|
445
|
-
}else{
|
446
|
-
|
447
|
-
bwB.write(stA);
|
448
|
-
|
449
|
-
bwB.newLine();
|
450
|
-
|
451
|
-
}
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
}else{
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
if(masterM[0][0].equals("○")){
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
bwA.write(stA);
|
464
|
-
|
465
|
-
bwA.newLine();
|
466
|
-
|
467
|
-
}else{
|
468
|
-
|
469
|
-
bwB.write(stA);
|
470
|
-
|
471
|
-
bwB.newLine();
|
472
|
-
|
473
|
-
}
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
}
|
478
|
-
|
479
|
-
}
|
480
|
-
|
481
|
-
}
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
sum = 0;
|
486
|
-
|
487
|
-
}
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
}catch(IOException e){
|
492
|
-
|
493
|
-
System.err.println("エラーが発生しました。");
|
494
|
-
|
495
|
-
e.printStackTrace();
|
496
|
-
|
497
|
-
}finally{
|
498
|
-
|
499
|
-
try {
|
500
|
-
|
501
|
-
if(brA != null){
|
502
|
-
|
503
|
-
brA.close();
|
504
|
-
|
505
|
-
}
|
506
|
-
|
507
|
-
if(bwA != null){
|
508
|
-
|
509
|
-
bwA.close();
|
510
|
-
|
511
|
-
}
|
512
|
-
|
513
|
-
if(bwB != null){
|
514
|
-
|
515
|
-
bwB.close();
|
516
|
-
|
517
|
-
}
|
518
|
-
|
519
|
-
}catch (IOException e) {
|
520
|
-
|
521
|
-
// TODO 自動生成された catch ブロック
|
522
|
-
|
523
|
-
e.printStackTrace();
|
524
|
-
|
525
|
-
}
|
526
|
-
|
527
|
-
}//finally
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
}//main
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
/**
|
538
|
-
|
539
|
-
* 半角数値チェック
|
540
|
-
|
541
|
-
* @param s 文字列
|
542
|
-
|
543
|
-
* @return true 正常 false エラー
|
544
|
-
|
545
|
-
*/
|
546
|
-
|
547
|
-
public static boolean isHanNum(String s){
|
548
|
-
|
549
|
-
try{
|
550
|
-
|
551
|
-
|
583
|
+
Double.parseDouble(s);
|
552
584
|
|
553
585
|
return true;
|
554
586
|
|
2
情報の追加をしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,31 +8,67 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
+
【仕様内容】
|
12
|
+
|
13
|
+
入力ファイルの数値をキーとして計算Cを読込みます。
|
14
|
+
|
15
|
+
読込んだ計算Cの値で入力ファイルの数値を除算します。
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
除算した結果が偶数の場合、判定Mの「002」を読込みます。
|
20
|
+
|
21
|
+
判定Mの値が「○」の場合、outAに入力ファイルの値を出力し、
|
22
|
+
|
23
|
+
「×」の場合は、outBに入力ファイルの値を出力します。
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
除算した結果が奇数の場合、判定Mの「001」を読込みます。
|
28
|
+
|
29
|
+
判定Mの値が「○」の場合、outAに入力ファイルの値を出力し、
|
30
|
+
|
31
|
+
「×」の場合は、outBに入力ファイルの値を出力します。
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
現時点では、演算子 / は引数の型 BufferedReader, String[] で未定義ですのエラーが出ており
|
36
|
+
|
37
|
+
実装出来ておりません。
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
```ここに言語を入力
|
46
|
+
|
11
47
|
入力file 計算C 判定M
|
12
48
|
|
13
|
-
|
49
|
+
キー 値
|
14
|
-
|
50
|
+
|
15
|
-
10 キー 値
|
51
|
+
10 キー 値 奇数 001,×
|
16
|
-
|
52
|
+
|
17
|
-
9
|
53
|
+
9 1,2 偶数 002,○
|
18
|
-
|
54
|
+
|
19
|
-
8
|
55
|
+
8 2,3
|
20
|
-
|
56
|
+
|
21
|
-
7
|
57
|
+
7 3,1
|
22
|
-
|
58
|
+
|
23
|
-
6
|
59
|
+
6 4,2
|
24
|
-
|
60
|
+
|
25
|
-
5
|
61
|
+
5 5,3
|
26
|
-
|
62
|
+
|
27
|
-
4
|
63
|
+
4 6,1
|
28
|
-
|
64
|
+
|
29
|
-
3
|
65
|
+
3 7,2
|
30
|
-
|
66
|
+
|
31
|
-
2
|
67
|
+
2 8,3
|
32
|
-
|
68
|
+
|
33
|
-
1
|
69
|
+
1 9,1
|
34
|
-
|
70
|
+
|
35
|
-
|
71
|
+
10,2
|
36
72
|
|
37
73
|
|
38
74
|
|
@@ -44,19 +80,21 @@
|
|
44
80
|
|
45
81
|
4 9
|
46
82
|
|
47
|
-
|
83
|
+
8
|
48
|
-
|
84
|
+
|
49
|
-
|
85
|
+
7
|
50
|
-
|
86
|
+
|
51
|
-
|
87
|
+
5
|
52
|
-
|
88
|
+
|
53
|
-
|
89
|
+
3
|
54
|
-
|
90
|
+
|
55
|
-
|
91
|
+
2
|
56
|
-
|
92
|
+
|
57
|
-
|
93
|
+
1
|
94
|
+
|
95
|
+
|
96
|
+
|
58
|
-
|
97
|
+
```
|
59
|
-
|
60
98
|
|
61
99
|
```ここに言語を入力
|
62
100
|
|
1
書式の改善をしました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,31 +8,31 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
入力
|
11
|
+
入力file 計算C 判定M
|
12
|
-
|
12
|
+
|
13
|
-
キー 値
|
13
|
+
キー 値
|
14
|
-
|
14
|
+
|
15
|
-
10 キー 値 奇数 001,×
|
15
|
+
10 キー 値 奇数 001,×
|
16
|
-
|
16
|
+
|
17
|
-
9 1,2 偶数 002,○
|
17
|
+
9 1,2 偶数 002,○
|
18
|
-
|
18
|
+
|
19
|
-
8 2,3
|
19
|
+
8 2,3
|
20
|
-
|
20
|
+
|
21
|
-
7 3,1
|
21
|
+
7 3,1
|
22
|
-
|
22
|
+
|
23
|
-
6 4,2
|
23
|
+
6 4,2
|
24
|
-
|
24
|
+
|
25
|
-
5 5,3
|
25
|
+
5 5,3
|
26
|
-
|
26
|
+
|
27
|
-
4 6,1
|
27
|
+
4 6,1
|
28
|
-
|
28
|
+
|
29
|
-
3 7,2
|
29
|
+
3 7,2
|
30
|
-
|
30
|
+
|
31
|
-
2 8,3
|
31
|
+
2 8,3
|
32
|
-
|
32
|
+
|
33
|
-
1 9,1
|
33
|
+
1 9,1
|
34
|
-
|
34
|
+
|
35
|
-
10,2
|
35
|
+
10,2
|
36
36
|
|
37
37
|
|
38
38
|
|
@@ -40,21 +40,21 @@
|
|
40
40
|
|
41
41
|
outA.csv outB.csv
|
42
42
|
|
43
|
-
6 10
|
43
|
+
6 10
|
44
|
-
|
44
|
+
|
45
|
-
4 9
|
45
|
+
4 9
|
46
|
-
|
46
|
+
|
47
|
-
8
|
47
|
+
8
|
48
|
-
|
48
|
+
|
49
|
-
7
|
49
|
+
7
|
50
|
-
|
50
|
+
|
51
|
-
5
|
51
|
+
5
|
52
|
-
|
52
|
+
|
53
|
-
3
|
53
|
+
3
|
54
|
-
|
54
|
+
|
55
|
-
2
|
55
|
+
2
|
56
|
-
|
56
|
+
|
57
|
-
1
|
57
|
+
1
|
58
58
|
|
59
59
|
|
60
60
|
|