(조건) ? (조건해당) : (조건해당안함)
// 점수가 70점 이상이면 합격 아니면 불합격 출력
Scanner sc=new Scanner(System.in);
System.out.printf("score : ");
int score=sc.nextInt();
String pass;
//if(score>70) pass="pass";
//else pass="fail";
pass=(score>70)? "pass": "fail";
System.out.println("scroe is "+pass);
System.out.printf("기본급: ");
int a=sc.nextInt();
// 기본급 100만원 이상->50%, 100만원 미만->60% 가산하여 지급액 출력
// code 1
double per=(a>=1000000)? 0.5:0.6;
System.out.println("총지급액"+(int)(a+a*per));
// code 2
double b=(a>=1000000)? a+a*0.5: a+a*0.6;
System.out.println("총지급액"+(int)b);