Блог пользователя Peteris

Автор Peteris, 14 лет назад, По-английски

What is the best way to embed source code in Codeforces currently? One way is by using pre tags:


int main()
{
  for (int i = 0; i < n; ++i)
    printf("testing %lf%%\n", (i + .5) * 100 / n);
  return 0;
}
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

14 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
First Url

Second Url

Maybe this urls can you help you ;)
14 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Fuck, this Wrong post :-D
14 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится
Maybe something like this (you need to check "Combine style and HTML code" option)

  1. int main()
  2. {
  3.   for (int i = 0; i < n; ++i)
  4.     printf("testing %lf%%\n", (i + .5) * 100 / n);
  5.   return 0;
  6. }
  7.  
14 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится
int main()
{
  for (int i = 0; i < n; ++i)
    printf("testing %lf%%\n", (i + .5) * 100 / n);
  return 0;
}
  • 14 лет назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится
    Example (the result is above):
    <pre class="prettyprint">int main()
    {
      for (int i = 0; i &lt; n; ++i)
        printf(&quot;testing %lf%%\n&quot;, (i + .5) * 100 / n);
      return 0;
    }
    </pre>
»
12 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится
Any idea why the highlighting is not working correctly for Java?
<pre class="prettyprint lang-java"> or <pre class="prettyprint java"> (just tried that one) and also <pre class="prettyprint"><class="language-java"> is not working = the formatted code is not similar to the code from prettifier project, there are incorrect keywords highlighted.

It will be great if there are other tags added to blog entry (format, formatting, highlighting) for easier search, thanks.