Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
\documentclass{article} \usepackage[vlined,ruled,linesnumbered]{algorithm2e} \usepackage{algpseudocode} \SetKwInput{KwInput}{Input} \SetKwInput{KwOutput}{Output} \SetKwInput{KwData}{Data} \begin{document} \begin{algorithm} \caption{Example code} \KwInput{Your Input} \KwOutput{Your output} \KwData{Testing set $x$} $\sum_{i=1}^{\infty} := 0$ \tcp*{this is a comment} \tcc{Now this is an if...else conditional loop} \If{Condition 1}{ Do Something \\ \If{sub-condition}{ Do a lot } }\ElseIf{Condition 2}{ Do Otherwise \tcc{Now this is a for loop} \For{sequence}{ loop instructions } } \Else{ Do the rest } \tcc{Now this is a While loop} \While{Condition}{ do something } \end{algorithm} \end{document}
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)