This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() | |
{ | |
const RANGES: [i32; 10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; | |
let mut triangles: i32 = 0; | |
for a in 0..RANGES.len()-2 | |
{ | |
for b in 1..RANGES.len()-a | |
{ | |
for c in 1..RANGES.len()-a-b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLEASE NOTE: | |
- We DO NOT recommend using the `Etc` timezones. Please select a real time region from the list, for example a country or city. | |
- Time region names are case sensitive | |
- Time regions don't contain spaces. The brackets at the end are for reference, and aren't a part of the name | |
Etc/GMT+12 (GMT -12) | |
Etc/GMT+11 (GMT -11) | |
Pacific/Midway (GMT -11) | |
Pacific/Niue (GMT -11) | |
Pacific/Pago_Pago (GMT -11) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def sq_digits(n): | |
nums = [] | |
div, mod = divmod(n, 10) | |
nums.append(mod) | |
while div >= 10: | |
div, mod = divmod(div, 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All languages with codes: | |
afrikaans (af) | |
albanian (sq) | |
amharic (am) | |
arabic (ar) | |
armenian (hy) | |
azerbaijani (az) | |
basque (eu) | |
belarusian (be) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int size = 1000000; | |
int main() | |
{ | |
bool li[size] = {false}; | |
for ( int i = 2; i < size; ++i ) | |
{ | |
if ( !li[i] ) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"ip" : "54.37.19.136", | |
"port" : 44139} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <cstring> | |
int main(int argc, char* argv[]) { | |
std::ifstream open_file; | |
std::ofstream output; | |
if (argc != 3) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
try: | |
filename = sys.argv[1] | |
indents = int(sys.argv[2]) | |
except ValueError: | |
raise ValueError('2nd arg must be integer') | |
except IndexError: | |
raise IndexError('Missing args') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
int main() | |
{ | |
std::string term = ""; | |
std::map<std::string, bool> missing; | |
bool complete = false; | |
do { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#$ main.cpp $1 | |
g++ -std=c++11 $1 -o mkcpp_main | |
./mkcpp_main | |
rm mkcpp_main |