1 Commits

Author SHA1 Message Date
4a9dad81f0 Department実装まで完了 2026-10-23 16:15:23 +09:00
9 changed files with 275 additions and 407 deletions

View File

@@ -1,3 +1,4 @@
09,代表取締役
10,役員 10,役員
11,人事・総務部 11,人事・総務部
12,経理部 12,経理部
1 10 09 役員 代表取締役
1 09 代表取締役
2 10 10 役員 役員
3 11 11 人事・総務部 人事・総務部
4 12 12 経理部 経理部

View File

@@ -8,3 +8,4 @@
10007,葉山稔,ハヤマミノル,mhayama@hoge.jp,hhh,14 10007,葉山稔,ハヤマミノル,mhayama@hoge.jp,hhh,14
10008,川上朱里,カワカミアカリ,kawakami@hoge.jp,iii,14 10008,川上朱里,カワカミアカリ,kawakami@hoge.jp,iii,14
10009,杉井肇,スギイハジメ,sugi@hoge.jp,jjj,15 10009,杉井肇,スギイハジメ,sugi@hoge.jp,jjj,15
10010,瓦昂世,カワラコウセイ,kawara@hoge.jp,kkk,09
1 10000 山田龍也 ヤマダタツヤ yamada@hoge.jp aaa 10
8 10007 葉山稔 ハヤマミノル mhayama@hoge.jp hhh 14
9 10008 川上朱里 カワカミアカリ kawakami@hoge.jp iii 14
10 10009 杉井肇 スギイハジメ sugi@hoge.jp jjj 15
11 10010 瓦昂世 カワラコウセイ kawara@hoge.jp kkk 09

View File

@@ -108,12 +108,4 @@ public abstract class BaseAccess {
* @throws IOException * @throws IOException
*/ */
public abstract void delete(String key) throws IOException; public abstract void delete(String key) throws IOException;
public List<BaseData> selectByidDepartment(String key) throws FileNotFoundException {
// TODO 自動生成されたメソッド・スタブ
return null;
}
} }

View File

@@ -9,34 +9,26 @@ import com.rhizome.example.data.BaseData;
import com.rhizome.example.data.DepartmentData; import com.rhizome.example.data.DepartmentData;
public class DepartmentAccess extends BaseAccess{ public class DepartmentAccess extends BaseAccess{
private static final String DEPDATA_FILEPATH = "file/DepartmentData.csv";
private static final String DEPARTMENT_FILEPATH = "file/DepartmentData.csv";
public DepartmentAccess() { public DepartmentAccess() {
super(DEPARTMENT_FILEPATH); super(DEPDATA_FILEPATH);
} }
@Override @Override
//条件検索用メソッド public List<BaseData> selectById(String key) throws FileNotFoundException {
public List<BaseData> selectByidDepartment(String key) throws FileNotFoundException {
//全件データ //全件データ
List<BaseData> allList = new ArrayList<>(); List<BaseData> allList = new ArrayList<>();
//取得用リスト(CSV形式) //取得用リスト(CSV形式)
List<String> csvList = readData(); List<String> csvList = readData();
for (String line : csvList) { for (String line : csvList) {
DepartmentData department = new DepartmentData(); DepartmentData department = new DepartmentData();
String[] columns = line.split(","); String[] columns = line.split(",");
department.setIdDepartment(columns[0]); department.setIdDepartment(columns[0]);
department.setNameDepartment(columns[1]); department.setNmDepartment(columns[1]);
allList.add(department); allList.add(department);
} }
//IDでの抽出データ //IDでの抽出データ
List<BaseData> selectList = new ArrayList<>(); List<BaseData> selectList = new ArrayList<>();
@@ -47,34 +39,8 @@ public class DepartmentAccess extends BaseAccess{
} }
return selectList; return selectList;
} }
//全件検索用メソッド
public List<BaseData> selectByallDepartment(String key) throws FileNotFoundException {
//全件データ
List<BaseData> allList = new ArrayList<>();
//取得用リスト(CSV形式)
List<String> csvList = readData();
for (String line : csvList) {
DepartmentData department = new DepartmentData();
String[] columns = line.split(",");
department.setIdDepartment(columns[0]);
department.setNameDepartment(columns[1]);
allList.add(department);
}
return allList;
}
@Override @Override
public void insert(BaseData data) throws IOException { public void insert(BaseData data) throws IOException {
//CSVファイルに追記する //CSVファイルに追記する
@@ -96,8 +62,7 @@ public class DepartmentAccess extends BaseAccess{
DepartmentData department = new DepartmentData(); DepartmentData department = new DepartmentData();
String[] columns = line.split(","); String[] columns = line.split(",");
department.setIdDepartment(columns[0]); department.setIdDepartment(columns[0]);
department.setNameDepartment(columns[1]); department.setNmDepartment(columns[1]);
allList.add(department); allList.add(department);
} }
@@ -132,8 +97,7 @@ public class DepartmentAccess extends BaseAccess{
DepartmentData department = new DepartmentData(); DepartmentData department = new DepartmentData();
String[] columns = line.split(","); String[] columns = line.split(",");
department.setIdDepartment(columns[0]); department.setIdDepartment(columns[0]);
department.setNameDepartment(columns[1]); department.setNmDepartment(columns[1]);
allList.add(department); allList.add(department);
} }
@@ -147,13 +111,4 @@ public class DepartmentAccess extends BaseAccess{
updateData(deletedList); updateData(deletedList);
} }
@Override
public List<BaseData> selectById(String key) throws FileNotFoundException {
// TODO 自動生成されたメソッド・スタブ
return null;
}
} }

View File

@@ -17,7 +17,6 @@ public class EmployeeAccess extends BaseAccess {
} }
@Override @Override
//条件検索用メソッド
public List<BaseData> selectById(String key) throws FileNotFoundException { public List<BaseData> selectById(String key) throws FileNotFoundException {
//全件データ //全件データ
List<BaseData> allList = new ArrayList<>(); List<BaseData> allList = new ArrayList<>();
@@ -25,7 +24,6 @@ public class EmployeeAccess extends BaseAccess {
//取得用リスト(CSV形式) //取得用リスト(CSV形式)
List<String> csvList = readData(); List<String> csvList = readData();
for (String line : csvList) { for (String line : csvList) {
EmployeeData employee = new EmployeeData(); EmployeeData employee = new EmployeeData();
String[] columns = line.split(","); String[] columns = line.split(",");
@@ -49,36 +47,8 @@ public class EmployeeAccess extends BaseAccess {
} }
return selectList; return selectList;
} }
//全件検索用メソッド
public List<BaseData> selectByall(String key) throws FileNotFoundException {
//全件データ
List<BaseData> allList = new ArrayList<>();
//取得用リスト(CSV形式)
List<String> csvList = readData();
for (String line : csvList) {
EmployeeData employee = new EmployeeData();
String[] columns = line.split(",");
employee.setIdEmployee(columns[0]);
employee.setNmEmployee(columns[1]);
employee.setKnEmployee(columns[2]);
employee.setMailAddress(columns[3]);
employee.setPassword(columns[4]);
employee.setIdDepartment(columns[5]);
allList.add(employee);
}
return allList;
}
@Override @Override
public void insert(BaseData data) throws IOException { public void insert(BaseData data) throws IOException {
//CSVファイルに追記する //CSVファイルに追記する

View File

@@ -19,5 +19,4 @@ public abstract class BaseData {
*/ */
public abstract String getPrimaryKeyValue(); public abstract String getPrimaryKeyValue();
} }

View File

@@ -4,7 +4,7 @@ public class DepartmentData extends BaseData{
/** 部署ID */ /** 部署ID */
private String idDepartment; private String idDepartment;
/** 部署名 */ /** 部署名 */
private String nameDepartment; private String nmDepartment;
/** /**
* @return 部署ID * @return 部署ID
@@ -12,6 +12,7 @@ public class DepartmentData extends BaseData{
public String getIdDepartment() { public String getIdDepartment() {
return idDepartment; return idDepartment;
} }
/** /**
* @param idDepartment 部署ID * @param idDepartment 部署ID
*/ */
@@ -22,32 +23,36 @@ public class DepartmentData extends BaseData{
/** /**
* @return 部署名 * @return 部署名
*/ */
public String getNameDepartment() { public String getNmDepartment() {
return nameDepartment; return nmDepartment;
} }
/** /**
* @param nameDepartment 部署名 * @param ndDepartment 部署名
*/ */
public void setNameDepartment(String nameDepartment) { public void setNmDepartment(String nmDepartment) {
this.nameDepartment = nameDepartment; this.nmDepartment = nmDepartment;
} }
/**
* {@inheritDoc}
*/
@Override @Override
public String toString() { public String toString() {
// TODO 自動生成されたメソッド・スタブ return getIdDepartment() + "\t" + getNmDepartment();
return getIdDepartment() + "\t" + getNameDepartment();
} }
@Override @Override
public String toCSV() { public String toCSV() {
// TODO 自動生成されたメソッド・スタブ return getIdDepartment() + "," + getNmDepartment();
return getIdDepartment() + "," + getNameDepartment();
} }
@Override @Override
public String getPrimaryKeyValue() { public String getPrimaryKeyValue() {
// TODO 自動生成されたメソッド・スタブ
return idDepartment; return idDepartment;
} }
} }

View File

@@ -1,234 +0,0 @@
package com.rhizome.example.main;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import com.rhizome.example.access.DepartmentAccess;
import com.rhizome.example.data.BaseData;
import com.rhizome.example.data.DepartmentData;
public class DepartmentMain {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
System.out.println("システムを開始します");
while (true) {
try {
new DepartmentMain ().dpData();
} catch (Exception e) {
System.out.println("予期せぬエラーが発生しました");
e.printStackTrace();
}
}
}
/**
* 処理選択を行う
* @throws IOException
*
*/
public void dpData() throws IOException {
System.out.println();
System.out.println("1:検索 2:登録 3:更新 4:削除 9:データ切り替え 0:終了");
String ope = sc.nextLine();
DepartmentMain dp = new DepartmentMain();
switch (ope) {
case "1": //検索
dpSelect();
break;
case "2": //登録
dpInsert();
break;
case "3": //更新
dpUpdate();
break;
case "4": //削除
dpDelete();
break;
case "0": //修了
System.out.println("システムを終了します");
System.exit(0);
case "9":
dp.dpData();
default:
System.out.println("指定の番号を入力してください");
break;
}
}
/**
* 社員ファイルから情報を検索する
*
* @throws FileNotFoundException
*/
public void dpSelect() throws FileNotFoundException {
System.out.println();
System.out.println("1:全件検索 2:条件検索");
String search = sc.nextLine();
switch(search) {
case "1": //全件検索
//DepartmentData.csvファイルに記載されている情報が一覧で表示
DepartmentAccess all = new DepartmentAccess();
List<BaseData> allList = new ArrayList<>();
allList = all.selectByallDepartment(search);
for (BaseData department : allList) {
System.out.println(department.toString());
}
break;
case "2": //条件検索
//IDの入力および入力チェック
DepartmentAccess ea = new DepartmentAccess();
List<BaseData> list;
//IDの入力および入力チェック
String id = inputCheck("ID", true);
//idに一致する社員データ取得
list = ea.selectByidDepartment(id);
if (list.size() == 0) { //取得結果が0件の場合
System.out.println("入力された値で情報がみつかりませんでした");
}
//取得結果件数分、データをタブ区切りで出力する
for (BaseData department : list) {
System.out.println(department.toString());
}
break;
default: //1.2以外なら戻る
try {
dpData();
} catch (IOException e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
} //メインメニューへ戻る
break;
}
}
/**
* 社員ファイルに情報を登録する
*
* @throws IOException
*/
public void dpInsert() throws IOException {
//各項目の入力および入力チェック処理
String id = inputCheck("部署ID", true);
String name = inputCheck("部署名", false);
//社員データインスタンスを生成し、入力値を設定
DepartmentData department = new DepartmentData();
department.setIdDepartment(id);
department.setNameDepartment(name);
DepartmentAccess ea = new DepartmentAccess();
//ファイルデータ追加処理
ea.insert(department);
System.out.println("登録が完了しました");
}
/**
* 社員ファイルの情報を更新する
*
* @throws IOException
*/
public void dpUpdate() throws IOException {
DepartmentAccess ea = new DepartmentAccess();
//IDの入力および入力チェック
String id = inputCheck("ID", true);
//IDの存在チェック
if (ea.selectById(id).size() == 0) {
System.out.println("入力された値で情報がみつかりませんでした");
return;
}
//各項目の入力および入力チェック処理
String name = inputCheck("部署名", false);
//社員データインスタンスを生成し、入力値を設定
DepartmentData department = new DepartmentData();
department.setIdDepartment(id);
department.setNameDepartment(name);
//ファイルデータ更新処理
ea.update(department);
System.out.println("更新が完了しました");
}
/**
* 社員ファイルの情報を削除する
*
* @throws IOException
*/
public void dpDelete() throws IOException {
DepartmentAccess ea = new DepartmentAccess();
//IDの入力および入力チェック
String id = inputCheck("ID", true);
//IDの存在チェック
if (ea.selectById(id).size() == 0) {
System.out.println("入力された値で情報がみつかりませんでした");
return;
}
System.out.println("指定されたIDの情報を削除します? Y/y");
System.out.println("(Y/y以外の入力であればキャンセル)");
String yY = sc.nextLine();
if (!"y".equals(yY) && !"Y".equals(yY)) {
System.out.println("削除をキャンセルしました");
return;
}
//ファイルデータ削除処理
ea.delete(id);
System.out.println("削除が完了しました");
}
/**
* 入力値を判定し、返却する
*
* @param titleName 入力項目名
* @param flg 数値チェック可否フラグ
* @return チェック済み入力値
*/
public static String inputCheck(String titleName, boolean flg) {
String str = null;
while (true) {
System.out.println(titleName + "を入力してください");
str = sc.nextLine();
if (str.trim().length() == 0) {
System.out.println(titleName + "は入力必須です。");
continue;
}
if (flg) {
if (str.trim().length() > 0) {
try {
Integer.parseInt(str);
} catch (NumberFormatException e) {
System.out.println(titleName + "は数値入力です");
continue;
}
}
}
break;
}
return str;
}
}

View File

@@ -1,16 +1,18 @@
package com.rhizome.example.main; package com.rhizome.example.main;
import java.io.BufferedReader;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Scanner; import java.util.Scanner;
import com.rhizome.example.access.DepartmentAccess;
import com.rhizome.example.access.EmployeeAccess; import com.rhizome.example.access.EmployeeAccess;
import com.rhizome.example.data.BaseData; import com.rhizome.example.data.BaseData;
import com.rhizome.example.data.DepartmentData;
import com.rhizome.example.data.EmployeeData; import com.rhizome.example.data.EmployeeData;
public class Main { public class Main {
static Scanner sc = new Scanner(System.in); static Scanner sc = new Scanner(System.in);
@@ -23,12 +25,13 @@ public class Main {
System.out.println("システムを開始します"); System.out.println("システムを開始します");
while (true) { while (true) {
try { try {
new Main().start(); new Main().Start();
} catch (Exception e) { } catch (Exception e) {
System.out.println("予期せぬエラーが発生しました"); System.out.println("予期せぬエラーが発生しました");
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
/** /**
@@ -36,15 +39,14 @@ public class Main {
* @throws IOException * @throws IOException
* *
*/ */
public void start() throws IOException { public void Start() throws IOException {
System.out.println(); System.out.println();
System.out.println("1:検索 2:登録 3:更新 4:削除 9:データ切り替え 0:終了"); System.out.println("1:検索 2:登録 3:更新 4:削除 9:データ切り替え 0:終了 (管理対象:Employee)");
String ope = sc.nextLine(); String ope = sc.nextLine();
DepartmentMain dp = new DepartmentMain();
switch (ope) { switch (ope) {
case "1": //検索 case "1": //検索 ←変えたとこ
empSelect(); empDivide();
break; break;
case "2": //登録 case "2": //登録
empInsert(); empInsert();
@@ -55,11 +57,12 @@ public class Main {
case "4": //削除 case "4": //削除
empDelete(); empDelete();
break; break;
case "0": //修了 case "9": //切り替え ←追加したとこ
Change();
break;
case "0": //終了
System.out.println("システムを終了します"); System.out.println("システムを終了します");
System.exit(0); System.exit(0);
case "9":
dp.dpData();
break; break;
default: default:
System.out.println("指定の番号を入力してください"); System.out.println("指定の番号を入力してください");
@@ -67,6 +70,129 @@ public class Main {
} }
} }
//自分がつくったところ 部署のデータ
public void departmentStart() throws IOException {
System.out.println();
System.out.println("1:検索 2:登録 3:更新 4:削除 9:データ切り替え 0:終了 (管理対象:Department)");
String ope = sc.nextLine();
switch (ope) {
case "1": //検索 おかしい
depDivide();
break;
case "2": //登録 おけ
depInsert();
break;
case "3": //更新 おけ
depUpdate();
break;
case "4": //削除 おかしい
depDelete();
break;
case "9": //切り替え おけ
Change();
break;
case "0": //終了 おけ
System.out.println("システムを終了します");
System.exit(0);
break;
default:
System.out.println("指定の番号を入力してください");
break;
}
}
//自分がつくったところ データ切り替えるか確認するばしょ
public void Change() throws IOException {
System.out.println();
System.out.println("データを切り替えますか?");
System.out.println("1:部署データへ 2:社員データへ 0:終了");
String ope = sc.nextLine();
switch (ope) {
case "1": //部署データに切り替える おけ
departmentStart();
break;
case "2": //社員データに戻る おけ
Start();
break;
case "0": //終了
System.out.println("システムを終了します");
System.exit(0);
break;
default:
System.out.println("指定の番号を入力してください");
break;
}
}
//自分がつくったところ 全検索か条件検索か
public void empDivide() throws IOException {
System.out.println();
System.out.println("1:全検索 2:条件検索 それ以外:戻る");
String ope = sc.nextLine();
switch (ope) {
case "1": //全検索 おけ
empExportcsv();
break;
case "2": //条件検索 おけ
empSelect();
break;
default:
break;
}
}
//自分がつくったところ 部署 全検索か 条件検索か
public void depDivide() throws IOException {
System.out.println();
System.out.println("1:全検索 2:条件検索 それ以外:戻る");
String ope = sc.nextLine();
switch (ope) {
case "1": //全検索 おけ
depExportcsv();
break;
case "2": //条件検索 おけ
depSelect();
break;
default:
break;
}
}
//自分がつくったとこ csv指定して出力
public void empExportcsv() throws IOException {
try (BufferedReader reader = new BufferedReader(new FileReader("file/EmployeeData.csv"))) {
String line;
while ((line = reader.readLine()) != null) {
String formatted = line.replace(",", " ");
System.out.println(formatted);
}
}
}
//自分がつくったとこ 部署csv指定して出力
public void depExportcsv() throws IOException {
try (BufferedReader reader = new BufferedReader(new FileReader("file/DepartmentData.csv"))) {
String line;
while ((line = reader.readLine()) != null) {
String formatted = line.replace(",", " ");
System.out.println(formatted);
}
}
}
/** /**
* 社員ファイルから情報を検索する * 社員ファイルから情報を検索する
@@ -74,26 +200,6 @@ public class Main {
* @throws FileNotFoundException * @throws FileNotFoundException
*/ */
public void empSelect() throws FileNotFoundException { public void empSelect() throws FileNotFoundException {
System.out.println();
System.out.println("1:全件検索 2:条件検索");
String search = sc.nextLine();
switch(search) {
case "1": //全件検索
//EmployeeData.csvファイルに記載されている情報が一覧で表示
EmployeeAccess all = new EmployeeAccess();
List<BaseData> allList = new ArrayList<>();
allList = all.selectByall(search);
for (BaseData employee : allList) {
System.out.println(employee.toString());
}
break;
case "2": //条件検索
//IDの入力および入力チェック
EmployeeAccess ea = new EmployeeAccess(); EmployeeAccess ea = new EmployeeAccess();
List<BaseData> list; List<BaseData> list;
@@ -105,24 +211,35 @@ public class Main {
if (list.size() == 0) { //取得結果が0件の場合 if (list.size() == 0) { //取得結果が0件の場合
System.out.println("入力された値で情報がみつかりませんでした"); System.out.println("入力された値で情報がみつかりませんでした");
} }
//取得結果件数分、データをタブ区切りで出力する //取得結果件数分、データをタブ区切りで出力する
for (BaseData employee : list) { for (BaseData employee : list) {
System.out.println(employee.toString()); System.out.println(employee.toString());
} }
break;
default: //1.2以外なら戻る
try {
start();
} catch (IOException e) {
// TODO 自動生成された catch ブロック
e.printStackTrace();
} //メインメニューへ戻る
break;
}
} }
//自分がつくったところ 部署ファイルから情報検索
public void depSelect() throws FileNotFoundException {
DepartmentAccess da = new DepartmentAccess();
List<BaseData> list;
//IDの入力および入力チェック
String id = inputCheck("ID", true);
//idに一致する社員データ取得
list = da.selectById(id);
if (list.size() == 0) { //取得結果が0件の場合
System.out.println("入力された値で情報がみつかりませんでした");
}
//取得結果件数分、データをタブ区切りで出力する
for (BaseData department : list) {
System.out.println(department.toString());
}
}
/** /**
* 社員ファイルに情報を登録する * 社員ファイルに情報を登録する
@@ -153,6 +270,23 @@ public class Main {
System.out.println("登録が完了しました"); System.out.println("登録が完了しました");
} }
//自分がつくったところ 部署ファイルに情報登録
public void depInsert() throws IOException {
//各項目の入力および入力チェック処理
String id = inputCheck("部署ID", true);
String name = inputCheck("部署名", false);
//部署データインスタンスを生成し、入力値を設定
DepartmentData department = new DepartmentData();
department.setIdDepartment(id);
department.setNmDepartment(name);
DepartmentAccess da = new DepartmentAccess();
//ファイルデータ追加処理
da.insert(department);
System.out.println("登録が完了しました");
}
/** /**
* 社員ファイルの情報を更新する * 社員ファイルの情報を更新する
* *
@@ -190,6 +324,29 @@ public class Main {
System.out.println("更新が完了しました"); System.out.println("更新が完了しました");
} }
//自分が作ったところ 部署データアップデート
public void depUpdate() throws IOException {
DepartmentAccess da = new DepartmentAccess();
//入力チェック
String id = inputCheck("部署ID", true);
//存在チェック
if (da.selectById(id).size() == 0) {
System.out.println("入力された値で情報がみつかりませんでした");
return;
}
//名前入力チェック
String name = inputCheck("部署名", false);
DepartmentData department = new DepartmentData();
department.setIdDepartment(id);
department.setNmDepartment(name);
//ファイルデータ更新処理
da.update(department);
System.out.println("更新が完了しました");
}
/** /**
* 社員ファイルの情報を削除する * 社員ファイルの情報を削除する
* *
@@ -205,7 +362,7 @@ public class Main {
System.out.println("入力された値で情報がみつかりませんでした"); System.out.println("入力された値で情報がみつかりませんでした");
return; return;
} }
System.out.println("指定されたIDの情報を削除します? Y/y"); System.out.println("指定されたIDの情報を削除しますか? Y/y");
System.out.println("(Y/y以外の入力であればキャンセル)"); System.out.println("(Y/y以外の入力であればキャンセル)");
String yY = sc.nextLine(); String yY = sc.nextLine();
if (!"y".equals(yY) && !"Y".equals(yY)) { if (!"y".equals(yY) && !"Y".equals(yY)) {
@@ -217,6 +374,30 @@ public class Main {
System.out.println("削除が完了しました"); System.out.println("削除が完了しました");
} }
//自分がつくったところ 部署データ削除
public void depDelete() throws IOException {
DepartmentAccess da = new DepartmentAccess();
//入力チェック
String id = inputCheck("部署ID", true);
//存在チェック
if (da.selectById(id).size() == 0) {
System.out.println("入力された値で情報がみつかりませんでした");
return;
}
System.out.println("指定されたIDの情報を削除しますか? Y/y");
System.out.println("(Y/y以外の入力であればキャンセル)");
String yY = sc.nextLine();
if (!"y".equals(yY) && !"Y".equals(yY)) {
System.out.println("削除をキャンセルしました");
return;
}
//ファイルデータ削除処理
da.delete(id);
System.out.println("削除が完了しました");
}
/** /**
* 入力値を判定し、返却する * 入力値を判定し、返却する
* *
@@ -248,6 +429,4 @@ public class Main {
return str; return str;
} }
} }