Skip to content

Instantly share code, notes, and snippets.

View mariusmg2's full-sized avatar

Marius Marusanici mariusmg2

  • Timisoara, România
View GitHub Profile
@mariusmg2
mariusmg2 / cerinta1.txt
Last active November 12, 2018 06:53
Cerinte Java
Sa se citeasca un numar natural N, urmat de un sir de N numere naturale.
Se cere afisarea acelor numere care se repeta de cel putin o data (+ de cate ori se repeta).
Ex: N: 7, sir: [4, 6, 3, 4, 2, 2, 0], Rezultat: 4->2, 2->2.
_12367890123456789012345678901234567890123456789012345678901234567890_
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <iostream>
#include <fstream>
@mariusmg2
mariusmg2 / preprocessor_fun.h
Created April 9, 2016 17:24 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@mariusmg2
mariusmg2 / tema3so.c
Created December 26, 2014 12:17
Tema 3 SO.
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <fcntl.h>
pid_t pid;
@mariusmg2
mariusmg2 / tema2oopLab.c++
Last active August 29, 2015 14:10
Tema 2 Lab. POO
// Version2, pastebin: http://pastebin.com/raw.php?i=Q4A83hdM [OUTDATED]
// clang++ -Wall -O3 -g tema2poo.c++ -o poo -std=c++14
#include <iostream>
#include <string>
#include <list>
using std::cin;
using std::cout;
using std::string;
@mariusmg2
mariusmg2 / source.c++
Last active August 29, 2015 14:08
Solution to POO Lab test.
#include <iostream>
#include <string>
#include <cstdlib>
using std::cout;
using std::cin;
using std::string;
using std::endl;
class Book {
@mariusmg2
mariusmg2 / tema1_L2.c
Last active August 29, 2015 13:57
Teme AC->TP.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int n, j = 0, i;
printf("\nValoarea lui n: "); scanf("%d", &n);
int *data = malloc(n * sizeof(*data));
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SMAX 128
#define BOOKS 100
typedef struct {
int price, edition;
char favCharacter[SMAX];
@mariusmg2
mariusmg2 / lsd.c
Created January 24, 2014 17:58
Some code from LSD course...
#include<stdio.h>
#include<stdlib.h>
typedef struct node {
int value;
struct node *left, *right;
} *BinaryIntTree;
BinaryIntTree emptyBinaryIntTree = NULL;