@@ -0,0 +1,1216 @@
+/*%0AID: yashary1%0ALANG: JAVA%0ATASK: friday%0A*/%0A%0Aimport java.io.*;%0Aimport java.util.*;%0A%0A%0Aclass friday%0A%7B%0A%09private static boolean isLeap(int year)%0A%09%7B%0A%09%09return year %25 4 == 0 && year %25 100 != 0 %7C%7C year %25 400 == 0;%0A%09%7D%0A%0A%09private static int dayAfterKDays(int day, int k)%0A%09%7B%0A%09%09return (day + k - 1) %25 7;%0A%09%7D%0A%0A  public static void main(String %5B%5D args) throws IOException%0A  %7B%0A    BufferedReader f = new BufferedReader(new FileReader(%22friday.in%22));%0A    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(%22friday.out%22)));%0A%0A    StringTokenizer st = new StringTokenizer(f.readLine());%0A%0A    int N = Integer.parseInt(st.nextToken());%0A%0A    // 0 = sat, 1 = sun, ..., 6 = fri%0A    int occurances%5B%5D = new int%5B7%5D;%0A%0A    int monthDays%5B%5D%5B%5D = %7B%7B31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31%7D,%0A  %09%09%09%09%09%09%09%09%09%09%09 %7B31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31%7D%7D;%0A%0A  %09int day = 2;%0A  %09for(int year = 1900; year %3C 1900 + N; year++)%0A  %09%7B%0A  %09%09for(int month = 0; month %3C 12; month++)%0A  %09%09%7B%0A  %09%09%09occurances%5BdayAfterKDays(day, 13)%5D++;%0A  %09%09%09day = dayAfterKDays(day, monthDays%5BisLeap(year) ? 1 : 0%5D%5Bmonth%5D + 1);%0A  %09%09%7D%0A  %09%7D%0A%0A  %09for(int i = 0; i %3C 7; i++)%0A  %09%7B%0A  %09%09out.print(occurances%5Bi%5D + (i == 6 ? %22%5Cn%22 : %22 %22));%0A  %09%7D%0A    %0A    out.close();%0A  %7D%0A%7D%0A

Create friday.java