Skip to content

Instantly share code, notes, and snippets.

View recursivitate2.cpp
#include <iostream>
using namespace std;
int suma(int n)
{
if(n==0)
return 0; //conditia de oprire (nu are sens sa mergem mai departe de 0)
else
return n+suma(n-1); //formula de recurenta
}
int n;
View recursivitate1.cpp
void mesaj() //antetul subprogramului/functiei
{
cout<<"Salut!"; //afisare "Salut!" pe ecran
mesaj(); //autoapelare
}
View Model2020SNs3e3.cpp
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream f("numere.in");
int n, x, count = 0;
f >> n;
View Model2020SNs3e2.cpp
#include <iostream>
#include <string.h>
using namespace std;
int main() {
int i, n, x, a[100], pos = 0, exista_mari = 0, exista_mici = 0;
cin >> n >> x;
View Model2020MIs3e3.cpp
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream f("numere.in");
int n, x, count = 0;
f >> n;
View Model2020MIs3e2.cpp
#include <iostream>
#include <string.h>
using namespace std;
int main() {
int n, no_words = 0, i, exista_mari = 0, exista_mici = 0;
char text[101], words[100][100], *p;
View Model2020MIs3e1.cpp
#include <iostream>
using namespace std;
void duplicare(int n, int &d) {
int p = 1, are_cifre_impare = 0;
d = 0;
while (n > 0) {
int ultima_cifra = n % 10;
View Model2020MIs2e3.cpp
#include <iostream>
using namespace std;
int main() {
int i, a[5][7];
/*
* inainte de secventa ceruta se poate citi matricea
* in acest moment, fara alte instructiuni,
* matricea contine elemente fara sens
View SN2019-s3e3.cpp
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream f("bac.txt");
int a, maxim = -1;
View SN2019-s3e2.cpp
#include <iostream>
using namespace std;
int main() {
int n, i, a[21];
cin >> n;
for (i = 0; i < n; i++)
You can’t perform that action at this time.