Skip to content

Instantly share code, notes, and snippets.

@AminBusiness
Last active June 13, 2018 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AminBusiness/86789dd9da2964e75eeb608334c6a56b to your computer and use it in GitHub Desktop.
Save AminBusiness/86789dd9da2964e75eeb608334c6a56b to your computer and use it in GitHub Desktop.
JS Bin// source https://jsbin.com/wumoges
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.replace(/\s*$/, '')
.split('\n')
.map(str => str.replace(/\s*$/, ''));
main();
});
function readLine() {
return inputString[currentLine++];
}
// Complete the solve function below.
function solve(year)
{
/*
Marie invented a Time Machine and wants to test it by time-traveling to visit Russia on the Day of the Programmer (the day of the year) during a year in the inclusive range from to .
From to , Russia's official calendar was the Julian calendar; since they used the Gregorian calendar system. The transition from the Julian to Gregorian calendar system occurred in , when the next day after January was February . This means that in , February was the day of the year in Russia.
In both calendar systems, February is the only month with a variable amount of days; it has days during a leap year, and days during all other years. In the Julian calendar, leap years are divisible by ; in the Gregorian calendar, leap years are either of the following:
Divisible by .
Divisible by and not divisible by .
Given a year, , find the date of the day of that year according to the official Russian calendar during that year. Then print it in the format dd.mm.yyyy, where dd is the two-digit day, mm is the two-digit month, and yyyy is .
*/
const y;
const minYear = 1700;
const maxYear = 2700;
}
function main() {
const ws = fs.createWriteStream(process.env.OUTPUT_PATH);
const year = parseInt(readLine(), 10);
let result = solve(year);
ws.write(result + "\n");
ws.end();
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.replace(/\s*$/, '')
.split('\n')
.map(str => str.replace(/\s*$/, ''));
main();
});
function readLine() {
return inputString[currentLine++];
}
// Complete the solve function below.
function solve(year)
{
/*
Marie invented a Time Machine and wants to test it by time-traveling to visit Russia on the Day of the Programmer (the day of the year) during a year in the inclusive range from to .
From to , Russia's official calendar was the Julian calendar; since they used the Gregorian calendar system. The transition from the Julian to Gregorian calendar system occurred in , when the next day after January was February . This means that in , February was the day of the year in Russia.
In both calendar systems, February is the only month with a variable amount of days; it has days during a leap year, and days during all other years. In the Julian calendar, leap years are divisible by ; in the Gregorian calendar, leap years are either of the following:
Divisible by .
Divisible by and not divisible by .
Given a year, , find the date of the day of that year according to the official Russian calendar during that year. Then print it in the format dd.mm.yyyy, where dd is the two-digit day, mm is the two-digit month, and yyyy is .
*/
const y;
const minYear = 1700;
const maxYear = 2700;
}
function main() {
const ws = fs.createWriteStream(process.env.OUTPUT_PATH);
const year = parseInt(readLine(), 10);
let result = solve(year);
ws.write(result + "\n");
ws.end();
}
</script></body>
</html>
'use strict';
const fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf-8');
let inputString = '';
let currentLine = 0;
process.stdin.on('data', inputStdin => {
inputString += inputStdin;
});
process.stdin.on('end', _ => {
inputString = inputString.replace(/\s*$/, '')
.split('\n')
.map(str => str.replace(/\s*$/, ''));
main();
});
function readLine() {
return inputString[currentLine++];
}
// Complete the solve function below.
function solve(year)
{
/*
Marie invented a Time Machine and wants to test it by time-traveling to visit Russia on the Day of the Programmer (the day of the year) during a year in the inclusive range from to .
From to , Russia's official calendar was the Julian calendar; since they used the Gregorian calendar system. The transition from the Julian to Gregorian calendar system occurred in , when the next day after January was February . This means that in , February was the day of the year in Russia.
In both calendar systems, February is the only month with a variable amount of days; it has days during a leap year, and days during all other years. In the Julian calendar, leap years are divisible by ; in the Gregorian calendar, leap years are either of the following:
Divisible by .
Divisible by and not divisible by .
Given a year, , find the date of the day of that year according to the official Russian calendar during that year. Then print it in the format dd.mm.yyyy, where dd is the two-digit day, mm is the two-digit month, and yyyy is .
*/
const y;
const minYear = 1700;
const maxYear = 2700;
}
function main() {
const ws = fs.createWriteStream(process.env.OUTPUT_PATH);
const year = parseInt(readLine(), 10);
let result = solve(year);
ws.write(result + "\n");
ws.end();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment