Bufnea+Horatiu

=__ **Din clasa a XI-a :** __=

SDASF. using namespace std; int l[10][10],sol[10][10],n,dx[]={-1,0,1,0},dy[]={0,1,0,-1}; int xma,yma,m,i,j,k,p,q; void citire { ifstream fin("d.in"); fin>>n>>m; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { fin>>l[i][j]; }} }
 * 1) include
 * 2) include
 * 3) include

void afis { for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { cout<0 && jnou>0 && inou<=n && jnou<=m) { if(sol[inou][jnou]==0 && l[inou][jnou]q) { q=l[i][j]; xma=i; yma=j; } if(l[i][j]>n>>k;

for(i=1;i<=n;i++)

{cin>>x[i];

if(prim(x[i])==0) {sn=sn+x[i];}}

sp=0;

p=0;

for(i=1;i<=n;i++)

{for(j=i+1;j<=n;j++)

{if(x[i]>x[j]) {k=x[i];

x[i]=x[j];

x[j]=k;}

}

}

a[1]=x[1];

p=prim(a[1]);

if(p==1) sp++;

y=2;

for(i=2;i<=n;i++)

{if(prim(x[i])==1)

{if(sp+x[i]>n;

for(i=1;i<=n;i++)

cin>>a[i];

ma=a[1];

for(i=1;i<=n;i++)

if(a[i]>=0) {cout<0) ok=0;

if(ok==1) {for(i=1;i<=n;i++)

if(a[i]>ma) ma=a[i];

cout<>n; for(i=1;i<=n;i++) {cin>>x[i]; if(x[i]>=1) { a[p]=x[i]; p++;}}
 * 1) include

m=0; for(i=1;i<=n;i++) {

for(j=i+1;j<=n;j++) { if(x[i]>x[j]) { k=x[i]; x[i]=x[j]; x[j]=k; } } }

for(i=1;i<=n;i++) if(x[i]<0) m++; if(m%2==0) { for(i=1;i<=m;i++) { a[p]=x[i]; p++; } } if(m%2==1) { for(i=1;i>n>>m;

for(i=1;i<=n;i++)

for(j=1;j<=m;j++)

f>>a[i][j];

}

int main

{

int i,j,size=0,k=0;

citire;

for(i=1;i<=n;i++)

{for(j=1;j<=m;j++)

f[a[i][j]]++;

}

for(i=0;i<=9;i++)

if (f[i]>n*m/2) cout<<"Cel mai mare este "<>n>>m;

f>>x1>>y1;

f>>x2>>y2;

for(i=1;i<=n;i++)

for(j=1;j<=m;j++)

f>>a[i][j];

}

void fill(int i, int j,int k)

{

if(a[i][j]==1) {a[i][j]=k;

fill(i-1,j+1,k);

fill(i-1,j,k);

fill(i-1,j-1,k);

fill(i,j-1,k);

fill(i,j+1,k);

fill(i+1,j+1,k);

fill(i+1,j,k);

fill(i+1,j-1,k);

}

}

int main

{

int i,j,max=0;

citire;

fill(x1,y1,2);

if(a[x1][y1]==a[x2][y2]) cout<<"Face parte din obiect";

else cout<<"Nu face parte din obiect";

cout<>n>>m;

for(i=1;i<=n;i++)

for(j=1;j<=m;j++)

f>>a[i][j];

}

void fill(int i, int j)

{

if(a[i][j]==1) {a[i][j]=2;

fill(i-1,j+1);

fill(i-1,j);

fill(i-1,j-1);

fill(i,j-1);

fill(i,j+1);

fill(i+1,j+1);

fill(i+1,j);

fill(i+1,j-1);

}

}

int main

{

int i,j,max=0,k=1;

citire;

for(i=1;i<=n;i++)

for(j=1;j<=m;j++)

{fill(i,j);

i=j=n+1;

}

for(i=1;i<=n;i++)

for(j=1;j<=m;j++)

if(a[i][j]==1)

{cout<<"Mai avem obiecte !";

return 1;

}

cout<<"Nu mai avem obiecte !";

}


 * 1) include


 * 1) include

using namespace std; int n,m,a[10][10],dmax,nrob,d; struct obiect{int i,j,cod;};
 * 1) include

obiect x[10]; void citire

{

int i,j;

ifstream f("txt");

f>>n>>m;

for(i=1;i<=n;i++)

for(j=1;j<=m;j++)

f>>a[i][j];

} void afisare

{

cout<<"Dimensiunea maxima este "<0) { k=a[i][j];

d=0;

fill(i,j,k);

if(d>dmax) {dmax=d;

x[1].i=i;

x[1].j=j;

x[1].cod=k;

nrob=1;

}

else if(d==dmax) { nrob++;

x[nrob].i=i;

x[nrob].j=j;

x[nrob].cod=k;

}

}

}

afisare;

}

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

__**Clasa a X-a :**__
using namespace std; double viteza(int d, int t){ double v; v=d/t; return v; } int main{ int d,t; cout<<"distanta pe care vreti sa o parcurgeti(m): "; cin>>d; cout<<"timpul in care ati ajuns(s): "; cin>>t; cout<<"viteza(m/s): "<>n;// //f>>corect;// //for(i=0;i>e[i].nume;// //f>>a;// //for(j=0;j<strlen(corect);j++)// //if(corect[j]==a[j])// //e[i].pct++;// //}// //}//

//void afisare// //{int i;// //for(i=0;i<n;i++)// //cout<<e[i].nume<<"-"<<e[i].pct<<endl;// //}//

//void ordonare// //{int i,j;// //for(i=0;i<n;i++)// //for(j=i+1;j<n;j++)// //if(e[i].pct<e[j].pct)// //swap(e[i],e[j]);// //}//

//int main// //{citire;// //ordonare;// //afisare;// //}//

//**Antetul functiei afisare:**//

//void afisare(int n ,int x[])// //{int i ;// //cout<<"Sirul x : ";// //for(i=0;i<n;i++)// //cout<<x[i]<<" ";// //cout<<"n = "<<n<<endl;// //}//


 * Probalilitati :**

a)Care este probabilitatea ca extragand un numar la intamplare, acesta sa fie par . b)Care este probabilitatea ca alegand un numar la intamplare , acesta sa fie divizibil cu 9. c)Care este probabilitatea ca alegand o pereche (a,b) din produsul cartezian A x A, aceasta sa aiba proprietatea a*b=12. d)Din multimea A se aleg k numere in mod aleator, unde k se citeste de la tastatura, Sa se afiseze cate sunt pare si cate sunt impare. e)N persoane fac k aruncari cu zarul . De cate ori arunca fiecare fata 6 ?
 * 1.__** Fie multimea A={1,2,...,n}.


 * Rezolvare:**

a)

//double par(int n)// //{//Fie multimea 1...n. int i,p=0; double l; p=n/2; l=p/(double)n; return l; }

b)

double divizibil(int n) { int i,p=0; double l; p=n/9; l=p/(double)n; return l; }

c)

double suma(int n, int s) {int i,j,k,t,q; k=t=0; for(i=1;i<=n;i++) for(j=1;j<=n;j++) if (i+j==s) t++; return t/(double)(n*n); }

d)

using namespace std; void generare( int n, int k, int &p, int &ip) {int f[10000]={0},j,nr; for(j=1;j<=k;) {nr=rand%n+1; if(f[nr]==0) {j++; f[nr]=1; cout<>n>>k; generare(n,k,p,ip); cout<>n>>k; srand(time(NULL)); aruncari(n,k); }

Proiect grafica :

int main {int driver, mod; initgraph(&driver, &mod, "", 1024, 768); int midx = getmaxx/2; int midy = getmaxy/2; double i=0; while(!kbhit) {i++; setcolor(15); line(150+i,400,500+i,400); circle(220+i,426,25); setcolor(CYAN); floodfill(220+i,426,15); setcolor(15); circle(400+i,426,25); setcolor(2); floodfill(400+i,426,15); setcolor(15); line(150+i,400,200+i,350); line(200+i,350,435+i,350); line(435+i,350,500+i,400); setcolor(4); floodfill(315+i,371,15); delay(10);
 * 1) include "graphics2.h"
 * 2) include

setcolor(0); line(150+i,400,500+i,400); circle(220+i,426,25); circle(400+i,426,25); line(150+i,400,200+i,350); line(200+i,350,435+i,350); line(435+i,350,500+i,400);

} }