diff --git a/sitou/src/B117_drivingschool.java b/sitou/src/B117_drivingschool.java new file mode 100644 index 0000000000000000000000000000000000000000..5b6f2bd8abcc86f5cc64fe8b4df1ad67d7c1e53f --- /dev/null +++ b/sitou/src/B117_drivingschool.java @@ -0,0 +1,28 @@ +package src; + +import java.util.ArrayList; +import java.util.Scanner; + +public class B117_drivingschool { + public static void main(String[] args) { + final Scanner sc = new Scanner(System.in); + final int howmanyCars = sc.nextInt(); + ArrayList carsList = new ArrayList<>(); + + for(int i = 0; i < howmanyCars; i++){ + carsList.add(sc.nextInt()); + } + + int roundCount = 0; + int outCarsNo = 1; + while(outCarsNo < howmanyCars) { + for(int cuurentCarsNo : carsList) { + if(currentCarsList == outCarsNo) outCarsNo++; + } + if(outCarsNo <= howmanyCars) roundCount++; + } + + System.out.println(roundCount); + sc.close(); + } +}