This file contains 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
cc = gcc -Wall | |
file = rand_test.c | |
bin = app.o | |
all: compile run | |
compile: | |
@clear | |
@$(cc) $(file) -o $(bin) |
This file contains 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
7 7 3 4 6 9 7 1 5 1 2 2 6 4 7 5 6 7 8 4 0 5 5 2 8 5 7 7 7 4 1 0 7 4 2 3 0 6 9 5 3 8 4 5 7 5 0 8 9 9 7 6 8 7 5 5 7 0 3 2 4 4 8 7 7 9 6 7 1 9 8 5 4 0 5 7 7 0 5 7 6 0 6 4 4 1 9 1 2 6 1 8 7 1 8 8 4 1 6 5 2 0 3 1 3 5 0 6 8 9 1 2 1 7 3 7 6 1 1 3 7 8 7 1 6 8 6 4 3 4 1 3 9 3 8 3 8 3 1 1 2 0 7 5 7 8 0 3 0 5 4 1 7 5 9 1 4 5 3 7 9 3 5 1 7 0 6 1 4 4 5 3 0 1 8 5 9 4 9 7 2 0 3 6 9 0 6 8 9 9 1 1 5 6 1 3 6 9 4 9 0 0 5 6 0 0 9 2 5 4 4 5 1 7 2 9 0 7 0 7 9 3 8 3 1 5 7 2 0 2 0 1 6 7 7 2 6 5 6 6 7 6 8 4 7 9 5 2 6 2 9 6 1 3 8 3 6 4 8 3 7 9 3 5 5 9 5 1 4 2 4 1 2 3 0 1 2 6 2 6 0 5 2 8 2 6 3 6 0 7 6 3 3 0 2 6 6 5 2 9 8 4 9 6 5 8 3 0 2 0 7 6 4 4 0 4 5 7 4 5 0 2 2 3 2 0 8 9 8 3 8 6 9 4 6 4 7 4 7 9 5 0 8 5 7 0 2 4 6 7 7 2 8 4 1 6 1 1 0 4 2 7 3 8 7 7 5 9 9 4 0 1 5 4 9 0 5 4 8 3 1 9 3 5 1 0 4 8 9 2 0 9 8 3 7 1 3 5 6 7 0 0 5 7 3 2 2 8 2 1 9 2 0 1 6 0 5 2 5 1 2 7 6 2 3 2 7 3 8 3 6 0 7 1 6 7 4 4 2 8 3 1 5 1 0 2 8 1 0 0 9 3 8 1 9 5 3 1 0 0 4 9 1 7 1 4 4 3 1 8 9 6 5 4 3 7 9 4 8 4 2 5 1 4 7 6 7 1 1 6 2 6 7 4 7 4 2 8 3 5 0 2 4 4 1 6 3 8 3 6 7 6 |
This file contains 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
# file name: employee.py | |
# calculating the gross pay | |
class Employee: | |
def __init__(self, name, job, salary): | |
self.name = name | |
self.job = job | |
self.salary = salary |
This file contains 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 objects from the math lib | |
# making use of some constants such as `pi` and `e`, | |
# some trig function like the cosine and sine | |
# and other functions | |
from math import ( | |
pi, e, | |
cos, sin, tan, | |
sqrt, pow, exp, | |
gcd, factorial |
This file contains 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
def say_hello() | |
print("hello") |
This file contains 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
# Problem definition and analysis | |
# Determine the maximum value obtainable by cutting | |
# up a rod and selling the pieces | |
# given given that the rod is of size, n | |
# and an array with the prices of pieces of the rod | |
# less than n | |
# For example, if length of the rod is 8 and the values of | |
# different pieces are given as following, then the maximum |
This file contains 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
# a program that inserts a str, "word" in the middle of another str, "out" | |
# this code make_out_word is very limit, i'd say won't even work | |
def make_out_word(out, word): | |
nstr = "" | |
leno = len(out) | |
if len(out) == 4: # replace with len(out) % 2 == 0 | |
for i in range(leno): | |
if i == 2: # replace with i == leno // 2 | |
nstr += str(word) |
This file contains 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
public class LoopTwice { | |
public static void main(String[] args) { | |
for (int i = 0; i < 2; i++) { | |
for (int x = 0; x < 5; x++) { | |
System.out.printf(x); | |
} | |
} | |
} | |
} |
This file contains 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
print("Hello world") |