Skip to content

Instantly share code, notes, and snippets.

#include <assert.h>
// Angle from 0000 hrs
int hour_hand_angle(int hour, int min)
{
return hour * 30 + min / 2;
}
// Angle from 0000 hrs
int min_hand_angle(int hour, int min)
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <time.h>
/* Insertion Sort */
void insertion_sort(long long arr[], int n) {
int i, j;
for (i = 1; i < n; i++) {
.text
main:
# Print string msg1
li $v0,4 # print_string syscall code = 4
la $a0, msg1 # load the address of msg
syscall
# Get input n from user and save
li $v0,5 # read_int syscall code = 5
syscall
def put_surplus_var(tab):
rows = len(tab)
cols = len(tab[0])
cols_add = rows - 1
tab = [x + [0]*cols_add for x in tab]
for i in range(1, rows):
for j in range(1, rows):
if i ==j: