File tree Expand file tree Collapse file tree 5 files changed +151
-0
lines changed
src/main/java/sgyj/backjun/yeji/class1p Expand file tree Collapse file tree 5 files changed +151
-0
lines changed Original file line number Diff line number Diff line change
1
+ package sgyj .backjun .yeji .class1p ;
2
+
3
+ import java .io .BufferedInputStream ;
4
+ import java .io .BufferedReader ;
5
+ import java .io .IOException ;
6
+ import java .io .InputStreamReader ;
7
+ import java .util .Arrays ;
8
+
9
+ // 최소, 최대
10
+ public class Main10818 {
11
+
12
+ public static void main ( String [] args ) {
13
+ try (InputStreamReader in = new InputStreamReader (System .in );
14
+ BufferedReader br = new BufferedReader ( in );){
15
+
16
+ int n = Integer .parseInt ( br .readLine () );
17
+ int min = Integer .MAX_VALUE ;
18
+ int max = Integer .MIN_VALUE ;
19
+ int [] s = Arrays .stream ( br .readLine ().split ( " " ) ).mapToInt ( Integer ::parseInt ).toArray ();
20
+
21
+ for (int r : s ){
22
+ min = Math .min ( r , min );
23
+ max = Math .max ( r ,max );
24
+ }
25
+
26
+ System .out .println (min + " " + max );
27
+
28
+ }catch ( IOException ex ){
29
+ ex .printStackTrace ();
30
+ }
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ package sgyj .backjun .yeji .class1p ;
2
+
3
+ import java .io .BufferedReader ;
4
+ import java .io .IOException ;
5
+ import java .io .InputStreamReader ;
6
+ import java .util .Arrays ;
7
+
8
+ // 아스키코드
9
+ public class Main10951 {
10
+
11
+ public static void main ( String [] args ) {
12
+ try ( InputStreamReader in = new InputStreamReader ( System .in );
13
+ BufferedReader br = new BufferedReader ( in );){
14
+
15
+ System .out .println (br .read ());
16
+
17
+ }catch ( IOException ex ){
18
+ ex .printStackTrace ();
19
+ }
20
+
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ package sgyj .backjun .yeji .class1p ;
2
+
3
+ import java .io .BufferedReader ;
4
+ import java .io .IOException ;
5
+ import java .io .InputStreamReader ;
6
+ import java .util .Arrays ;
7
+
8
+ // A+B - 5
9
+ public class Main10952 {
10
+
11
+ public static void main ( String [] args ) {
12
+ try ( InputStreamReader inputStreamReader = new InputStreamReader ( System .in );
13
+ BufferedReader br = new BufferedReader ( inputStreamReader );){
14
+ StringBuilder answer = new StringBuilder ();
15
+ String line ;
16
+ while ( (line = br .readLine ()) != null && !line .isBlank () ){
17
+ int [] s = Arrays .stream (line .split ( " " ) ).mapToInt ( Integer ::parseInt ).toArray ();
18
+ if (s [0 ]+s [1 ] != 0 ){
19
+ answer .append ( s [0 ]+s [1 ] ).append ( "\n " );
20
+ }
21
+ }
22
+ System .out .println (answer );
23
+ }catch ( IOException ex ){
24
+ ex .printStackTrace ();
25
+ }
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ package sgyj .backjun .yeji .class1p ;
2
+
3
+ import java .io .BufferedReader ;
4
+ import java .io .IOException ;
5
+ import java .io .InputStreamReader ;
6
+ import java .util .Arrays ;
7
+ import java .util .HashSet ;
8
+ import java .util .Set ;
9
+
10
+ public class Main11720 {
11
+
12
+ public static void main ( String [] args ) {
13
+ try (InputStreamReader in = new InputStreamReader ( System .in );
14
+ BufferedReader br = new BufferedReader ( in );){
15
+
16
+ br .readLine ();
17
+ int result = Arrays .stream ( br .readLine ().split ( "" ) ).mapToInt ( Integer ::parseInt ).sum ();
18
+ System .out .println (result );
19
+
20
+ }catch ( IOException ex ){
21
+ ex .printStackTrace ();
22
+ }
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ package sgyj .backjun .yeji .class1p ;
2
+
3
+ import java .io .BufferedReader ;
4
+ import java .io .IOException ;
5
+ import java .io .InputStreamReader ;
6
+
7
+ // OX퀴즈
8
+ public class Main8958 {
9
+
10
+ public static void main ( String [] args ) {
11
+ try (InputStreamReader in = new InputStreamReader ( System .in );
12
+ BufferedReader br = new BufferedReader ( in );){
13
+
14
+ int n = Integer .parseInt (br .readLine ());
15
+ int [] answer = new int [n ];
16
+
17
+ for (int i =0 ; i <n ; i ++){
18
+ answer [i ] = solution (br .readLine ().split ( "" ));
19
+ }
20
+
21
+ for ( int a : answer ){
22
+ System .out .println (a );
23
+ }
24
+
25
+ }catch ( IOException ex ){
26
+ ex .printStackTrace ();
27
+ }
28
+ }
29
+
30
+ private static int solution (String [] input ){
31
+ int result = 0 ;
32
+
33
+ int n = 1 ;
34
+ for (String in : input ){
35
+ if ("O" .equals ( in )){
36
+ result += n ;
37
+ n ++;
38
+ }else {
39
+ n = 1 ;
40
+ }
41
+ }
42
+
43
+ return result ;
44
+ }
45
+
46
+ }
You can’t perform that action at this time.
0 commit comments