This file contains hidden or 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
// 백엔드 원근영 | |
public class JavaEx06 { | |
public static void main(String[] args) { | |
int sum=0; | |
for(int i=1; i<=100; i++){ | |
sum+=i; | |
} | |
System.out.println("1부터 100까지의 합 : "+ sum); |
This file contains hidden or 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
// 백엔드 원근영 | |
public class JavaEx05 { | |
public static void main(String[] args) { | |
int num=90; | |
if(num>80){ | |
System.out.println("합격!"); | |
}else{ | |
System.out.println("불합격!"); |
This file contains hidden or 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
// 백엔드 원근영 | |
public class JavaEx04 { | |
public static void main(String[] args) { | |
int dollar=10000; | |
int n= 3500; | |
int total= dollar -n; | |
System.out.println("거스름돈: " + total+"원" ); |
This file contains hidden or 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
// 백엔드 원근영 | |
public class JavaEx03 { | |
public static void main(String[] args) { | |
int a=10; | |
double b= a; | |
System.out.println("=== 업캐스팅 ==="); | |
System.out.println("int 값: "+ a); |
This file contains hidden or 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
// 백엔드 원근영 | |
public class JavaEx02 { | |
public static void main(String[] args) { | |
int a=Integer.MAX_VALUE; | |
int b=Integer.MIN_VALUE; | |
double c=Double.MAX_VALUE; |
This file contains hidden or 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
// 백엔드 원근영 | |
public class JavaEx01 { | |
public static void main(String[] args) { | |
System.out.println("Hello World"); | |
} | |
} |
NewerOlder