Skip to content

Instantly share code, notes, and snippets.

View pcnoic's full-sized avatar
🌍
Working from planet earth

Christos Alexiou pcnoic

🌍
Working from planet earth
View GitHub Profile
@pcnoic
pcnoic / bestcode.c
Created January 21, 2021 22:59
code that will save your live
#include <stdio.h>
#include <stdlib.h>
int *read(int);
int oria(int,int);
int readx();
int ready();
int oriay(int,int);
void printc(int *);
int poscomb(int);
@pcnoic
pcnoic / printer.c
Created January 21, 2021 21:08
weird printing function
void print(int *A, int N)
{
int i;
for ( i = 0 ; i < N ; i++)
printf("%d ", *(A + i);
printf("\n");
}
@pcnoic
pcnoic / forloops.c
Created January 21, 2021 21:02
for loops for finding all combinations
for (j = 1; j <= n; j++) {
for (i = 0; i < n-1; i++) {
temp = num[i];
num[i] = num[i+1];
num[i+1] = temp;
print(num, n);
}
}
@pcnoic
pcnoic / combinations.py
Last active January 21, 2021 20:56
all possbile combinations of numbers
from itertools import permutations
comb = permutations([1, 2, 3], 3)
for i in comb:
print(i)