국비지원 JAVA 풀스택 과정/JAVA

[JAVA] 일년이 몇주인지 출력하는 프로그램

ODaram 2022. 9. 23. 22:26

·일년이 몇주인지 출력하는 프로그램

public class EEEEE {
	public static void main(String[] args){
		// 1년은 365일이고, 1주는 7일이므로 365/7 나누기
		int year = 365;
		int week = 7;
		
		int result = year/week;
		System.out.println("일년은"+result+"주 이다.");
	}
}