-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
255 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="src" path=""/> | ||
<classpathentry kind="output" path=""/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>2025-SS-welcome-test</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.wst.validation.validationbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> | ||
<classpathentry kind="src" path=""/> | ||
<classpathentry kind="output" path=""/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.eclipse.wst.jsdt.launching.JRE_CONTAINER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Global |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/Fan.class | ||
/a.class | ||
/b.class | ||
/c.class | ||
/d.class | ||
/e.class | ||
/f.class | ||
/g1.class | ||
/g2.class | ||
/Book.class | ||
/EBook.class | ||
/PrintedBook.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package java_test; | ||
import java.util.*; | ||
|
||
public class a { | ||
public static void main(String[] args) { | ||
|
||
// 이 부분에 code를 작성해주세요! | ||
|
||
Scanner sc=new Scanner(System.in); | ||
String str=sc.nextLine(); | ||
StringBuffer sb=new StringBuffer(str); | ||
System.out.println(sb.reverse()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
package java_test; | ||
import java.util.*; | ||
|
||
public class b { | ||
public static void main(String[] args) { | ||
|
||
// 이 부분에 code를 작성해주세요! | ||
|
||
Scanner sc=new Scanner(System.in); | ||
String str=sc.nextLine(); | ||
String[] arr= {"a", "e", "i", "o", "u"}; | ||
|
||
for(String s : arr) { | ||
if(str.contains(s)) { | ||
System.out.println("O"); | ||
System.exit(0); | ||
} | ||
} | ||
System.out.println("X"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
package java_test; | ||
import java.util.*; | ||
|
||
public class c { | ||
public static void main(String[] args) { | ||
|
||
// 이 부분에 code를 작성해주세요! | ||
|
||
Scanner sc=new Scanner(System.in); | ||
int num1=sc.nextInt(); | ||
int num2=sc.nextInt(); | ||
|
||
if(num1<14 && num2<155) { | ||
System.out.println("O"); | ||
}else { | ||
System.out.println("X"); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
package java_test; | ||
import java.util.*; | ||
|
||
public class d { | ||
public static void main(String[] args) { | ||
|
||
// 이 부분에 code를 작성해주세요! | ||
|
||
Scanner sc=new Scanner(System.in); | ||
while(true) { | ||
int num=sc.nextInt(); | ||
if(num<=0) { | ||
System.out.println("X"); | ||
break; | ||
} | ||
System.out.println(num*(num+1)/2); | ||
break; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
package java_test; | ||
import java.util.*; | ||
|
||
public class e { | ||
public static void main(String[] args) { | ||
|
||
// 이 부분에 code를 작성해주세요! | ||
|
||
Scanner sc=new Scanner(System.in); | ||
int num1=sc.nextInt(); | ||
int num2=sc.nextInt(); | ||
|
||
if(num2==4 || num2==6 || num2==9 || num2==11) { | ||
System.out.println("30"); | ||
}else if(num1%4==0 && (num1%100!=0 || num1%400==0) && num2==2) { | ||
System.out.println("29"); | ||
}else if(num2==2) { | ||
System.out.println("28"); | ||
}else { | ||
System.out.println("31"); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
package java_test; | ||
|
||
// 이부분에 class 선언 해도 괜찮습니다 | ||
import java.util.*; | ||
|
||
public class f { | ||
public static void main(String[] args) { | ||
|
||
// 이 부분에 code를 작성해주세요! | ||
|
||
Scanner sc=new Scanner(System.in); | ||
int num=sc.nextInt(), p=1; | ||
|
||
for(int i=1, j=num-1; i>0 ;i+=p*2, j-=p) { | ||
if(i>num*2) { | ||
p*=-1; | ||
i+=p*2; j-=p; | ||
continue; | ||
} | ||
for(int k=0; k<j ;k++) System.out.print(" "); | ||
for(int k=0; k<i ;k++) System.out.print("*"); | ||
System.out.println(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,45 @@ | ||
package java_test; | ||
|
||
// 이부분에 class 선언 해도 괜찮습니다 | ||
|
||
public class g1 { | ||
public static void main(String[] args) { | ||
|
||
// 이 부분에 code를 작성해주세요! | ||
|
||
} | ||
|
||
} | ||
package java_test; | ||
import java.util.*; | ||
|
||
class Fan implements Comparable<Fan> { | ||
private String model; | ||
private int price; | ||
|
||
Fan(String model, int price) { | ||
this.model=model; | ||
this.price=price; | ||
} | ||
|
||
String getModel() { return model; } | ||
int getPrice() { return price; } | ||
|
||
@Override | ||
public int compareTo(Fan o) { | ||
if(this.price>o.price) { | ||
return 1; | ||
}else if(this.price<o.price) { | ||
return -1; | ||
}else { | ||
return 0; | ||
} | ||
} | ||
} | ||
|
||
public class g1 { | ||
public static void main(String[] args) { | ||
Scanner sc=new Scanner(System.in); | ||
ArrayList<Fan> fan=new ArrayList<>(); | ||
|
||
for(int i=0; i<3 ;i++) { | ||
if(i!=0) sc.nextLine(); | ||
String model=sc.nextLine(); | ||
int price=sc.nextInt(); | ||
fan.add(new Fan(model, price)); | ||
} | ||
|
||
Collections.sort(fan); | ||
System.out.println(fan.get(0).getModel()); | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,94 @@ | ||
package java_test; | ||
|
||
// 이부분에 class 선언 해도 괜찮습니다 | ||
|
||
public class g2 { | ||
public static void main(String[] args) { | ||
|
||
// 이 부분에 code를 작성해주세요! | ||
|
||
} | ||
|
||
} | ||
package java_test; | ||
import java.util.*; | ||
|
||
abstract class Book implements Comparable<Book> { | ||
String title; | ||
int price; | ||
double rating; | ||
|
||
@Override | ||
public int compareTo(Book o) { | ||
if(this.rating>o.rating) { | ||
return -1; | ||
}else if(this.rating<o.rating) { | ||
return 1; | ||
}else { | ||
return 0; | ||
} | ||
} | ||
|
||
abstract int getExtra(); | ||
} | ||
|
||
class EBook extends Book { | ||
int fileSize; | ||
|
||
EBook(String title, int price, double rating, int fileSize) { | ||
this.title=title; | ||
this.price=price; | ||
this.rating=rating; | ||
this.fileSize=fileSize; | ||
} | ||
|
||
int getExtra() { return fileSize; } | ||
} | ||
|
||
class PrintedBook extends Book { | ||
int pageCount; | ||
|
||
PrintedBook(String title, int price, double rating, int pageCount) { | ||
this.title=title; | ||
this.price=price; | ||
this.rating=rating; | ||
this.pageCount=pageCount; | ||
} | ||
|
||
int getExtra() { return pageCount; } | ||
} | ||
|
||
public class g2 { | ||
public static void main(String[] args) { | ||
ArrayList<Book> arr=new ArrayList<>(); | ||
Scanner sc=new Scanner(System.in); | ||
boolean isFirst=true; | ||
for(int i=0; i<3 ;i++) { | ||
if(!isFirst) sc.nextLine(); | ||
String genre=sc.nextLine(); | ||
if(!genre.equals("EBook") && !genre.equals("PrintedBook")) { | ||
System.out.println("Invalid book type. Please enter 'EBook' or 'PrintedBook'."); | ||
isFirst=true; | ||
i--; | ||
continue; | ||
} | ||
String title=sc.nextLine(); | ||
try { | ||
int price=sc.nextInt(); | ||
double rating=sc.nextDouble(); | ||
int extra=sc.nextInt(); | ||
|
||
if(genre.equals("EBook")) { | ||
arr.add(new EBook(title, price, rating, extra)); | ||
}else { | ||
arr.add(new PrintedBook(title, price, rating, extra)); | ||
} | ||
}catch(Exception e) { | ||
System.out.println("잘못된 입력입니다. 처음부터 다시 입력하세요."); | ||
i--; | ||
} | ||
isFirst=false; | ||
} | ||
|
||
Collections.sort(arr); | ||
Book book=arr.get(0); | ||
System.out.println("Highest rated book information:"); | ||
System.out.println("Title: "+book.title); | ||
System.out.println("Price: "+book.price); | ||
System.out.println("Rating: "+book.rating); | ||
if(book.getClass().getName().contains("Printed")) { | ||
System.out.println("Page Count: "+book.getExtra()); | ||
}else { | ||
System.out.println("File Size: "+book.getExtra()); | ||
} | ||
} | ||
} | ||
|