var numerals = [ "ноль" , "один" , "два" , "три" , "цетыре" , "пять" , "шесть" , "семь" , "восемь" , "девять" , "десять" , "одиннадцать" , "двенадцать" , "тринадцать" , "четырнадцать" , "пятнадцать" , "шестнадцать" , "семнадцать" , "восемнадцать" , "девятнадцать" , "двадцать" , "тридцать" , "сорок" , "пятьдесят" , "шестьдесят" , "семьдесят" , "восемьдесят" , "девяносто" ] ;
numerals10 = [ 0 , 0 , "двадцать" , "тридцать" , "сорок" , "пятьдесят" , "шестьдесят" , "семьдесят" , "восемьдесят" , "девяносто" ] ;
function mod( a, b) { return Math .round ( a/ b - a% b/ 10 ) }
function l( c) { print( c) }
function numberToWord( number) {
return number< 21 ? numerals[ number] : number% 10 === 0 ? numerals10[ mod( number, 10 ) ] : numerals10[ mod( number, 10 ) ] + " " + numberToWord( number% 10) ;
}
function ending( a) { return ( a% 10 === 0 ) || ( a% 10> 4 ) || ( ( a% 100> 9 ) && ( a% 100< 21 ) ) ? "ов" : a% 10 === 1 ? "" : "а" } //a%10 === 1?"": a%10 < 5?"а":"ов"}
function hard( ) {
var firstPhrase = "В этом предложении ровно " ;
var secondPhrase = " символ" ;
for ( var i= 1 ; i< 100 ; i++ ) {
var sentenceLength = firstPhrase.length + numberToWord( i) .length + secondPhrase.length + ending( i) .length + 1 ;
if ( sentenceLength === i) {
var sentence = firstPhrase + numberToWord( i) + secondPhrase+ ending( i) + "." ;
l( sentence) ;
l( sentence.length ) ;
}
}
}
hard( )
dmFyIG51bWVyYWxzICAgPSBbItC90L7Qu9GMIiwi0L7QtNC40L0iLCLQtNCy0LAiLCLRgtGA0LgiLCLRhtC10YLRi9GA0LUiLCLQv9GP0YLRjCIsItGI0LXRgdGC0YwiLCLRgdC10LzRjCIsItCy0L7RgdC10LzRjCIsItC00LXQstGP0YLRjCIsItC00LXRgdGP0YLRjCIsItC+0LTQuNC90L3QsNC00YbQsNGC0YwiLCLQtNCy0LXQvdCw0LTRhtCw0YLRjCIsItGC0YDQuNC90LDQtNGG0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