Skip to content

Instantly share code, notes, and snippets.

Avatar
🚑
Git problems? Better Call Luca

Andrew Luca iamandrewluca

🚑
Git problems? Better Call Luca
View GitHub Profile
View numara.cpp
// #include ...
int numara(int ** a, int n, int m)
{
int count = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
if (a[i][j] >= 0 && a[i][j] <=0)
count++;
@iamandrewluca
iamandrewluca / dots.c
Last active Jan 3, 2016
Making in a string from multiple dots one dot
View dots.c
#include <stdio.h>
#include <string.h>
int main(void) {
// your code goes here
char text[] = ".andrei... luca..varu.jora...a......sula.....";
char * ptext = text;
char * punct = ".";
int numarPuncte = 0;
int lungime = 0;
@iamandrewluca
iamandrewluca / square_root.c
Last active Jan 3, 2016
Extract number from a square root in 2 numbers
View square_root.c
#include <stdio.h>
#include <math.h>
int main()
{
int x = 20;
int v1 = x, v2;
while ((v1 > 1) && ((x / (int)pow(v1,2)) != (x / pow(v1,2)))) v1--;
v2 = x / pow(v1,2);
@iamandrewluca
iamandrewluca / Matrice.cpp
Created Feb 21, 2014
Supraincarcarea operatorului [][] in C++ creind o matrice.
View Matrice.cpp
/**
Titlu: Supraincarcarea operatorului [][] in C++ creind o matrice.
Autor: Luca Andrei
Ideone: http://ideone.com/y8Km37
Descriere: De fapt operatorul [][] nu poate fi supraincarcat,
deoarece el nu este operator )), ma contrazic pe mine ce am scris in titlu ).
De fapt aici sunt doi operatori []. Pentru a "supraincarca" [][], avem nevoie
sa cream 2 clase, si pentru fiecare in parte sa supraincarcam [].
Urmariti exemplul de mai jos pentru lamurire.
/**/
View bootstrap-block-grid.css
[class*="block-grid-"] {
display: block;
margin: -15px;
padding: 0;
}
[class*="block-grid-"]:before,
[class*="block-grid-"]:after {
content: " ";
display: table;
}
View increment-suffix-postfix.cpp
#include <iostream>
class Punct
{
private:
float x;
float y;
public:
Punct(): x(.0f), y(.0f) { std::cout << "default" << std::endl; }
Punct(float _x, float _y): x(_x), y(_y) { std::cout << "general" << std::endl; }
View poly.cpp
// in cazul tau e polimorfism pe functii curate ))
// nu sunt sigur daca merge, dar de ce nu
typedef struct {
int a;
char b;
float c;
// ... alte tipuri
} elev;
View md.cpp
//=============================================================================
// ----- Inceputul programului
//=============================================================================
/*
Name: Algoritmul de determinare a grafului de acoperire
Copyright: Luca
Author: Luca Andrei
Date: 28/05/12 18:42
Description: Acest program determina graful de acoperire
View md1.cpp
#include<stdio.h>
#include<conio2.h>
#include<stdlib.h>
#include<dos.h>
typedef struct val {
unsigned v:2;
}val;
void ver_m_i();
View threads.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace pr2
{
class Program
You can’t perform that action at this time.