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 <stdio.h> | |
#define ROWS 1001 | |
int main() { | |
int levels; | |
int sum = 0; | |
int corner = 1; | |
int row_length = 2; | |
for(levels = 0; levels < ROWS/2; ++levels) { | |
sum += (2*corner + row_length*3)*2; |
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
from math import sqrt | |
d = pow(10, 6) | |
factors = [-1, -1] | |
primes = [] | |
def phi(i): | |
res = 1 | |
index = 0 | |
while index < len(factors[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
#include <iostream> | |
void tree(int d, int n); | |
long long int found = 0; | |
int target = 1000000; | |
void tree(int d, int n) { | |
if(d > target) | |
return; | |
found += 1; |
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
// Parent class with two properties, one integer and one object | |
var ParentClass = function() { | |
this.counter = 0; | |
this.obj = { counter : 0 }; | |
this.inca = function() { | |
this.counter++; | |
this.obj.counter++; | |
} | |
}; |
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
#!/usr/bin/python | |
import sys, re, os | |
SCAN_EXTENSIONS = ["js", "html", "php", "py", "rb"] | |
def error_in_line(line): | |
return True if re.search(",}", line) else False# Check inside a line | |
def search_file(filename): | |
try: |
NewerOlder