Skip to content

Instantly share code, notes, and snippets.

@chbtoys
Created June 29, 2021 19:04
Show Gist options
  • Save chbtoys/5b2121b315265a4394db587db94dde0b to your computer and use it in GitHub Desktop.
Save chbtoys/5b2121b315265a4394db587db94dde0b to your computer and use it in GitHub Desktop.
Code Examples. From Paper to Code.
// From Paper to Code
// Sigma - Summation
// Run with: https://www.jdoodle.com/online-compiler-c++17/
// LaTeX: \sum_{i=1}^{2} \sum_{j=4}^{6} (3ij)
// Test LaTeX: https://quicklatex.com/
#include <iostream>
int main() {
int sum=0;
for (int i = 1; i <= 2; i++) {
for (int j = 4; j <= 6; j++) {
sum += (3 * i * j);
}
}
std::cout << "Sum = " << sum << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment