Skip to content

Instantly share code, notes, and snippets.

View thinkphp's full-sized avatar
💭
If I have seen further it is only by standing on the shoulders of giants. Newton

Adrian Statescu thinkphp

💭
If I have seen further it is only by standing on the shoulders of giants. Newton
View GitHub Profile
@thinkphp
thinkphp / mergesort.cpp
Created November 17, 2015 06:42
merge sort with operator new and delete
#include <fstream>
#include <iostream>
#define FIN "algsort.in"
#define FOUT "algsort.out"
using namespace std;
class Container {
public:
int main() {
int n;
ifstream fin( FIN );
ofstream fout( FOUT );
fin>>n;
#include <fstream>
#include <iostream>
#define FIN "algsort.in"
#define FOUT "algsort.out"
class Container {
public:
//constructor of the class
Container( int _n ): n( _n ){
(function(){
var animating = false;
function animatecard(ev) {
if (animating === false) {
var t = ev.target;
if (t.className === 'but-nope') {
t.parentNode.classList.add('nope');
animating = true;
fireCustomEvent('nopecard',
/* Design of a card */
.card {
font-size: 14px;
line-height: 200px;
text-align:center;
width: 150px;
height: 200px;
display: block;
background: #666;
-webkit-transform-origin: 50% 99%;
/**
* Filename: binarytreesearch.c
* Copyright (c) 2016 Adrian Statescu (http://adrianstatescu.com)
* Licensed under the MIT, GPL licenses.
*/
#include <stdio.h>
#include <malloc.h>
#define FIN "algsort.in"
#define FOUT "algsort.out"
int **pp;
int *p;
int ii;
p = &ii;
pp = &p;
**pp = 2016;
printf("%d", ii); //display 2016
#include <iostream>
#include <fstream>
#include <vector>
#define loop(vec) for(const auto &number : vec)
#define iter(i,begin,end) for(int i = begin; i <= end; ++i)
#define FIN "algsort.in"
#define FOUT "algsort.out"
using namespace std;
#include <stdio.h>
#include <malloc.h>
#define FIN "algsort.in"
#define FOUT "algsort.out"
int* read(int* arr, int* n) {
int i,
num;
@thinkphp
thinkphp / leibniz_PI.c
Last active September 6, 2023 08:39
C program to compute the value of PI using formula's Leibniz.
/**
*
* Author : Adrian Statescu mergesortv@gmail.com http://adrianstatescu.com
*
* C program to compute the value of PI using formula's Leibniz.
* PI approximate 4 ( 1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11...
*
* MIT License
*
*/