날짜 계산 (https://www.acmicpc.net/problem/1476)
모듈로 연산의 결과를 변경하여 출력해야함.
ex) 0을 15로 표현해야 함.
14 % 15 = 14
15 % 15 = 0 -> 15
16 % 15 = 1
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int e = Integer.parseInt(st.nextToken());
int s = Integer.parseInt(st.nextToken());
int m = Integer.parseInt(st.nextToken());
int cnt=1;
while (true) {
int mE = (cnt %15==0)? 15: cnt %15 ;
int mS = (cnt % 28==0)? 28: cnt %28;
int mM = (cnt % 19==0)? 19:cnt %19;
if( mE == e && mS==s && mM ==m)
break;
cnt ++;
}
System.out.println(cnt);
/*
int cnt = 7980;
System.out.printf("%d %d %d\n" , cnt %15 , cnt % 28 ,cnt % 19 );
if ( (cnt %15== e || cnt %15== 0 ) && (cnt % 28 ==s || cnt % 28 == 0 )&& (cnt % 19 == m || cnt % 19 == 0)) {
System.out.println("ok");
} else {
System.out.println("not ok");
}
*/
}
}