Rezolvari Bilete A Toate

Descărcați ca doc, pdf sau txt
Descărcați ca doc, pdf sau txt
Sunteți pe pagina 1din 2

`Billet 1 C++ #include<fstream.

h> I nt prim(int n) { int i ; if (n==1)return 0; fo r(i=2;i<=n/2;i++) if(n%i==0)return 0; return 1;} void main() {int n,i ,nr=0; cout<<n=;cin>>n; ofstream f(out.txt) for(i=1;i<=n;i++) if(n%i==0) {f<<i<< ; if(prim(i)==1)nr++;} f<<endl<<nr; f.close(); }

FOX Elev.dbf Nume C(20) Clasa C(5) Varsta N(2) Media N(5,2) clear use elevi.dbf index on tag varsta e descending browse fields nume,clasa, varsta average media to x for clasa=10C ?media generala a clasei a 10C=,x use *delete file elevi.dbf

Bilet 2 C++ #include<iostream.h> int prim(long n) {int ok;long i ; if(n==1) return 0; ok=1; for(i=2;i<=n/2;i++) if(n%i==0) ok=0; return ok; } int superprim(long n) {int ok; ok=1; while(n!=0) {if(prim(n)==0) ok=0; n=n/10;} return ok;} void main() {int i ,n,k; cout<<n=;cin>>n; i=1; k=0; while(k<n) {if(superprim(i)==1 ){cout<<i<< ;k=k+1;} i=i+1;} }

FOX Materia.dbf Nume C(20) Pret N(5) Firma C(20) clear use material.dbf calculate max(pret) to x browse for pret=x calculate sum(pret) to x ?TVA total platit,x*0,18 wait delete for firma=Sc Mecanica Sa *pack browse

Bilet 3 C++ #include<iostream.h> int palindrom(int x) {int y,ogl; y=x;ogl=0; while(y!=0) {ogl=ogl*10+y%10; y=y/10;} if(ogl==x)return 1; else return 0; } void main() {int a,b,s,nr,i ; cout<<a=;cin>>a; cout<<b=;cin>>b; s=0;nr=0; for(i=a+1;i<=b;i++) if(palindrom(i)==1) {s=s+i;nr=nr+1;} cout<<(float)s/nr; }

FOX Medic.dbf Nume C(20) Pret N(5) Data_exp D Compensat L clear set century on use medic.dbf calculate max(pret) to x browse for pret=x delete for data_exp<date() *pack browse browse fields nume,pret,compensate for Compensat=.T.

Bilet 4 C++ #include<iostream.h> int suma(long x) {int s; s=0; while(x!=0) {s=s+x%10;x=x/10;} return s; } void main() {long n[30],y; int x,i ,n; cout<<n=;cin>>n; for(i=1;i<=n;i++) {cout<<v[<<i<<]=;cin>>v[i];} cout<<x=;cin>>x; for(i=1;i<=n:i++) {y=v[i]; while(y>10) y=suma(y); if(y==x)cout<<v[i]<< ; } }

FOX Bac.dbf Nume C(30) Clasa C(5) Nro N(5,2) Nrs N(5,2) Nmate N(5,2) Media N(5,2) clear use bac.dbf replace all media with (Nro+Nrs+Nmate)/3 index on nume tag e browse for media <6 browse fields Nume,Nro,Nrs,Nmate for nume=Popescu delete for clasa=XII C *pack browse

Bilet 5 C++ #include<iostream.h> void main() {int v[30],n,i ,ok,j,aux; cout<<n=;cin>>n; for(i=1;i<=n;i++) {cout<<v[<<i<<]=;cin>>v[i];} ok=1; for(i=1;i<=n-1;i++) for(j=i+1;j<=n;j++) if(v[i]==v[j]) ok=0; if(ok==1) cout<<Elementele formeaza o multime; else {cout<<Elementele nu formeaza o multime; i=1; while(1<n) {ok=1; for(j=i+1;j<=n;j++) if(v[i]==v[j])ok=0; if(ok==0) {for(j=i+1;j<=n;j++) v[j]=v[i]; n=n-1;} else i=i+1;} for(i=1;i<=n-1;i++) for(j=i+1;j<=n;j++) if(v[i]>v[j]){aux=v[i];v[i]=v[j];v[j]=aux;} for(i=1;i<=n;i++)cout<<v[i]<< ; }

FOX Produs.dbf Nume C(30) Cod N(5) Pret N(5) clear use produs.dbf index on nume tag e descending browse titleproduse in ordine descrescatoare dupa nume n=space(20) @2,3 say dati nume produs get n read browse for nume=n calculate cnt() to x for pret <100 ?nr produse,x

Bilet 6 C++ #include< fstream.h> #include<math.h> void main() {int a[20][20],n,m,i ,j,max; ifstream f(in.txt) f>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) f>>a[i][j]; max=abs(a[1][1]); for(i=1;i<=n;i++) for(j=1;j<=m;j++) if(abs(a[i][j]>max))max=abs(a[i][j]); ofstream g(out.txt); g<<max<<endl; for(i=1;i<=n;i++) for(j=1;j<=m;j++) if(max==abs(a[i][j]))g<<i<< <<j<<endl; f.close(); g.close(); }

FOX Bac.dbf Nume C(30) N1 N(5,2) N2 N(5,2) N3 N(5,2) N4 N(5,2) N5 N(5,2) Medg N(5,2) clear use bac.dbf replace all medg with 0 replace medg with (N1+N2+N3+N4+N5)/5 for(N1>=5)AND(N2>=5)AND(N3>=5)A ND(N4>=5)AND(N5>=5) browse sort to promovati.dbf on medg/d,nume/a fields nume,medg for medg<>0 sort to respinsi.dbf on nume/a fields nume,medg for medg=0 use promovati.dbf browse use respinsi.dbf browse use promovati.dbf browse for recno()<=3

Bilet 7 C++ #include<fstream.h> #include<string.h> void main() {char s[16];int k,i ,n; cout<<s=;cin>>s; n=strlen(s) ofstream f(out.txt) f<<s<<endl; for(k=0;k<=n-1;k++) {for(i=0;i<=k;i++) f<<s[i]; f<< ;} for(k=n-1;k>=0;k--) {for(i=k;i<=n-1;i++) f<<s[i]; f<< ;} f.close(); }

FOX Atestat.dbf Nume C(20) N1 N(5,2) N2 N(5,2) N3 N(5,2) Practic N(5,2) Proiect N(5,2) Medg N(5,2) Tema C(30) clear use atestat.dbf replace all practic with(n1+n2+n3)/3 replace all medg with (practic+proiect)/2 browse index on nume tag e ascending browse fields nume,medg for medg=10 browse fields nume,n1,n2,n3 for nume=Popescu copy to teme.dbf for proiect>9 fields nume,tema use teme.dbf browse

Bilet 8 C++ #include<fstream.h> void main() {int n,m, i ,j,a[10][10],s; Ifstream f(in.txt) f>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) f>>a[i] [j]; ofstream g(out.txt); for(i=1;i<=n;i++) {s=0; for(j=1;j<=m;j++) s=s+a[i][j]; g<<s<< ;} g<<endl; for(j=1;j<=m;j++) {s=0; for(i=1;i<=n;i++) s=s+a[i][j]; g<<s<< ;} f.close(); g.close(); }

FOX Moda.dbf Nume C(20) Colectie C(20) An N(4) Salariu N(6) clear use moda.dbf browse for upper(colectie)=Toamna and an=year(date()) calculate max(salariu) for an=year(date()) to x browse fields nume,salariu for salariu=x delete all for an<year(date())-5 *pack browse

Bilet 9 C++ #include<iostream.h> int suma(long n) {int s;s=0; While(n!=0) {s=s+n%10; n=n/10;} return s; } void main() {int x,i;long s; cout<<x=;cin>>x; s=0; for(i=1;i<=x;i++) s=s+I; cout<<suma(s); }

FOX Miscari.dbf Magazine N(2) Nrdoc N(2) Datadoc D Tipdoc C(3) Denumire C(30) Pret N(5,2) Cantitate N(8,2) clear set century on use miscari.dbf browse calculate sum(pret*cantitate) to x for tipdoc=nir calculate sum(pret*cantitate) to y for tipdoc=aee ?valoarea totala a articolelor intrate,x ?valoarea totala a articolelor iesite,y wait(waitApasati o tasta pentru a continua) delete for month(datadoc)=4ANDyear(datadoc)=year(date()) *pack browse

Bilet 10 C++ #include<iostream.h> void main() {int p,q,x,y,a[20][20],i,j,aux,ok; cout<<p=;cin>>p; cout<<q=;cin>>q; for(i=1;i<=p;i++) for(j=1;j<=q;j++) {cout<<a[<<i<<][<<j<<]=;cin>>a[i][j];} .for(i=1;i<=p;i++) {for(j=1;j<=q;j++) cout<<a[i][j]<< ; cout<<endl;} cout<<x=;cin>>x; cout<<y=;cin>>y; for(i=1;i<=p;i++) {aux=a[i][x];a[i][x]=a[i][j];a[i][j]=aux;} for(i=1;i<=p;i++) {for(j=1;j<=q;j++) cout<<a[i][j]<< ; cout<<endl;} if(p!=q) cout<<Matricea nu este patrata; else {ok=1; for(i=1;i<=p;i++) if(a[i][i]>a[i+1][i+1])ok=0; if(ok==1)cout<<Sunt ordonate crescator; else cout<<Nu sunt ordonate crescator; } }

FOX Admit.dbf Nume C(20) Opt1 C(3) Opt2 C(3) Opt3 C(3) Opt4 C(3) Opt5C(3) Lro N(5,2) Mat N(5,2) clear use admit.dbf browse index on(lro+mat)/2 tag e1 descending browse for (lro>5)and(mat>5)titleElevi in ordine descrescatoare dupa medie index on nume tag e2 browse for (lro<5)or(mat<5) titleElevi respinsi in ordine descrescatoare dupa medie

Bilet 11 C++ # include <iostream.h> long putere (int a, int b) {int i; if(b==0) return 1; else return a*putere (a,b-1);} void main () { int p,q,k,i;float s,x; cout<<p=;cin>>p; cout<<q=;cin>>q; cout<<k=;cin>>k; s=0;x=1; for(i=1;i<=k;i++) {s=s+putere(p,i); x=x*putere(q,i);} cout<<valoarea expresiei este:<<s/x; }

FOX Bilet 12 C++ clear use sponsori.dbf ?Nr total sponsori, reccount() wait calculate fields nume,suma for suma =x index on nume tag e browse fields nume, localitate for localitate=Targoviste FOX #include <iostream.h> long fibo(int k) {if ((k==1)||(k==2)) return 1; else return fibo (k1)+fibo(k-2);} void main () {int n,I;long s; cout<<dati n impar;cin>>n; i=1;s=0; for(i=1;i<=n;i++) if(i%2!=0) s=s+fibo(i); cout<<suma=<<s;} clear use tari.dbf browse for populatie>200 titletari cu populatie>200 browse fields nume, polulatie, continent for continent=europa titlepopulatie tari europa dimension v[6] v[1]=asia v[2]=africa v[3]=america de nord v[4]=america de sud v[5]=europa v[6]=australia for i=1 to 6 calculate max(populatie) to x for continent=v[i] if(x<>0) browse fields nume, suprafata,continent for populatie=x and continent=v[i] titletari cu suprafata maxima endif

FOX Bilet 13(C++) FOX clear use clasa.dbf copy to naveta.dbf for navetist =.T. copy to loco.dbf for navetist =.F. use naveta.dbf browse ?nr elevi navetisti, reccount() use loco.dbf browse ?nr elevi localnici reccount() use naveta.dbf index on localitate tag e do while not eof() l=localitate nr=0 ?localitate, localitate do while l=localitate ? nume nr=nr+1 skip enddo ?nr elevi din,l,nr enddo Bilet 14 C++ #include <fstream.h> int prim (int n) {int i, ok; ok=1; if (n==1) return 0; for (i=2;i<=n/2;i++) if (n%i++0) ok=0; return ok;} void main ( ) {int x,s; ifstream f(in.txt); fstream g(in.txt,ios::app) s=0; while (f>>x) if (prim (x)==0) s=s+x; g<<endl<<s; f.close(); g.close(); } FOX clear use salar.dbf browse title salarii initiale replace salariu with salariu +0.3*salariu for salariu<500 replace salariu with salariu+0.25*salariu for (salariu>=500)and(salariu<750) replace salariu with salariu+0.2*salariu for salariu>=750 browse calculate min(salariu) to x browse for salariu=x calcilate max(salariu) to x ?salariul cel mai mare,x Bilet 15 C++ # include<fstream.h> void main () {inta[20][20],m,n,i,j,s3,s5,s8; ifstreamf(in.txt) f>>m>>n; for(i=1;i<=m;i++) for(j=1;j<=n;j++) f>>a[i][j]; f.close(); s3=0;s5=0;s8=0; s3=a[1][1]+a[1][n]+a[m][1]+a[m][n]; for(i=2;i<=n-1;i++) s5=s5+a[1][i]+a[m][i]; for(i=2;i<=m-1;i++) s5=s5+a[i][1]+a[i][n]; for(i=2;i<=m-1;i++) for(j=2;j<=n-1;j++) s8=s8+a[i][j]; ofstream g(out.txt); g<<s3<<endl<<s5<<endl<<s8; g.close();} clear use elevi in 1 use elevi in 2 sele 2 replace all med with (nrom+nmat)/2 browse title mediile elevilor sele 2 index on nr_matr to nm sele1 set relation to nr_matr into 2 browse fields nume, clasa,b.med title nume , clasa si media delete for b.med<=5.99 in 1 delete for b.med<=5.99 in 2 sele 1 *pack brose sele 2 *pack browse close all

# include<fstream.h> {int n,x; ifstream g(in.txt, ios::app); n=0; while (f>>x) n=n*10+x; g<<endl<<n; f.close();g.close();}

FOX Bilet 16 C++ FOX # include <iostream.h> void main ( ) clear {int i, a[20][20], k,s1,s2; use carti.dbf k=1; ?nr carti, reccount() for(i=1;i<=8;i++) browse for {for(j=1;j<=8;j++) autor=sadoveanu {a[i][j]=k;k=k+1;} calculate sum(pret) to x for(i=1;i<=8;i++) ?pret total, x {for(j=1;j<=8;j++) cout<<a[i][j]<< ;cout<<endl;} s1=0;s2=0; for(i=1;i<=8;i++) for(j=1;j<=8;j++) if(i%2!=0) if(j%2==0) s2=s2+a[i][j]; else s1=s1+a[i][j]; else if (j%2==0) s1=s1+a[i][j]; cout<<suma patrate albe<<s1<<endl; cout<<suma patrate negre<<s2; } Bilet 17 C++ clear #include <iostream.h> use masini.dbf int n, v[20]; index on marca tag e void tipar () browse {int i; count to x for marca = for(i=1;i<=n;i++) dacia cout<<v[i]<< ; ?nr masini dacia, x cout<<endl;} append int valid (int k) {int i, ok; ok=1; for(i=1;i<=k-1;i++) if(v[i]==v[k]) ok=0; if(k>1&&(v[k]+v[k-1])%%2==0) ok=0; return ok;} void BKT( ) {int k; k=1; v[k]=0; whuile(k>0) {while (v[k]<n) {v[k]=v[k]+1; if(valid(k)==1 if(k==n) tipar ( ); else{k=k+1;v[k]=0;} } k=k-1;}} void main( ) {cout<<n=;cin>>n; BKT( );} FOX Bilet 18 C++ clear use salar.dbf calculate sum (salariu) to x ?impozit total,, 0.25*x wait clear s=space(30) @ 2,3 say Dati sectia get s read index on nume tag e browse for (categorie=muncitor) and (sectia=s) calculate cnt() to x for categorie=muncitor ?muncitori, x Bilet 30 C++ #include<iostream.h> void main() {int a[50],b[50],p,q,i,j,nr,ok; cout<<p=;cin>>p; cout<<q=;cin>>q; for(i=1;i<=p;i++) {cout<<a[<<i<<]=;cin>>a[i];} for(i=1;i<=q;i++) {cout<<b[<<i<<]=;cin>>b[i];} nr=0; cout<<Multimea A intersectat cu B<<endl; for(i=1;i<=p;i++) {ok=0; for(j=1;j<=q;j++) if(a[i]==b[j])ok=1; if(ok==1){cout<<a[i]<< ;nr=nr+1;} } cout<<endl; cout<<A intersectat cu B are<<nr<<elemente<<endl; nr=0; cout<<Multimea B-A; for(i=1;i<=p;i++) {ok=0; for(j=1;j<=q;j++) if(b[i]==a[j])ok=1; if(ok==1){cout<<b[i]<< ;nr=nr+1;} } cout<<endl; cout<<Multimea B-A are<<nr<<elemente; }

#include<iostream.h> int prim(int x) {int i, ok; ok=1; if (x==1 return 0; for (i=2;i<=x/2;i++) if(x%i==0) ok=0; return ok;} void main ( ) {int n,i,j,nr,x,max; cout<<n=;cin>>n; max=0; for(i=1;i<=n;i++) {nr=0; for(j=2;j<=i/2;j++) {nr=0; for(j=2;j<=i/2;j++) if((i%j==0)&&(prim(j)==1) nr=nr+1; if(nr>max) {max=nr;x=i;}} cout<<x;}

FOX Masini.dbf Marca C(20) Pret N(10) clear use masini.dbf index on marca tag e browse fields marca,pret titleLista alfabetica calculate cnt() to x for marca=Dacia ?Numar de masini cu marca Dacia,x wait clear append blank @2,3 say Marca get marca @3,3 say Pret get pret read browse

FOX Bilet 19 C++ #include <iostream.h> void main( ) {int a[50],b[50],p,q,i,j,ok,nr; cout<<p=;cin>>p; for(i=1;i<=p;i++) {cout<<a[<<i<<]=;cin>>a[i];} cout<<q=;cin>>q; for(i=1;i<=q;i++)) {cout<<:b[<<i<<]=;cin>>b[i];} cout<<elementele lui a reunit cu b; nr=0; for(i=1;i<=q;i++) {ok=0; for(j=1;j<=p;j++) if(b[i]==a[j]) ok=1; if(ok==0) {cout<<b[i]<< ; nr=nr+1;} cout<<endl<<cardinalul lui a reunit cu b<<nr+p<<endl; cout<<elementele lui a minus b; nr=0; for(i=1;i<=p;i++) {ok=0; for(j=1;j<=q;j++) if(a[i]==b[j]) ok=1; if (ok==0) {cout<<b[i]<< ;nr=nr+1;} cout<<cardinalul lui a minus b<<nr;} clear use tari.dbf calculate max(populatie) to x browse fields nume populatie for populatie=x index on suprafat tag e descending browse fields nume, suprafata calculate sum (populatie) to x for continent=europa ?populatie totala europa,x

Bilet 20 C++ FOX #include<iostream.h> void main( ) {int n, i, val, nr; char c; cout<<nr de caractere; cin>>n; for(i=1;i<=n;i++) {cout<<caracter=;cin>>C; if((c>=a)&&(c<=f)) val=c-a+1; else if (c>=A) &&(c<=F) val=c-A+10; else val=c-0; nr=nr*16+val;} cout<<nr;} clear use judet.dbf browse fields oras, populatie for oras =targoviste browse fields oras, populatie for oras=pucioasa calculate cnt() to x for judet = arges ?nr locuitori arges,x select judet, sum(supr_oras) as supr_judet from judet.dbf group by judet; into dbf t1.dbf use t1.dbf calculate max(supr_judet) to x browse for supr_judet=x

Bilet 21 C++ FOX # include <fstream.h> void main() {int a[20][20],i,j,m,n,x,y; ifstream f(date.txt) f>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) a[i][j]=0; for(i=1;i<=m;i++) {f>>x>>y; a[x][y]=1; a[y][x]=1;} for(i=1;i<=n;i++) {for(j=1;j<=n;j++) cout<<a[i][j]<< ; cout<<endl;} for(i=1;i<=n;i++) cout<<vecinii nodului<<i<<:; {for(j=1;j<=m;j++) if(a[i][j]==1)cout<<j<< ; cout<<endl;} f.close(); } clear use bani.dbf replace salariu with salariu+salariu*0.05 for sectia=forja browse fields salariu, nume for nume=popescu ion calculate sum (salariu) to x ?impozit total, x*0.22

Bilet 22 C++ FOX # include <iostream.h> void main ( ) {int p,v[20],x,i,st,dr,m,ok; cout<<p=;cin>>p; for(i=1;i<=p;i++) {cout<<v[<<i<<]=;cin>>v[i];} cout<<x=;cin>>x; st=1; dr=p; ok=0; while(st<=dr&&ok==0) {m=(st+dr)/2; if(v[m]==x) ok=1; else if(v[m]>x) st=m+1; else dr=m_1;} if (ok==1 cout<<nr se afla in sir; else cout<<nr nu se afla in sir;} clear use elevi.dbf locate for nume =popescu @ 2,30 say datele elevului popescu @ 3,2 say replicate(_,65) @ 4,2 say nume elev @ 4,30 say clasa @ 4,50 say numar matricol @ 5,2 say replicate(_,65) @ 6,2 say nume @ 6,30 say clasa @ 6,50 say nrmatricol calculate cnt() to x for clasa=XB ?nr elevi XB, x use * delete file elevi.dbf

Bilet 23 C++ FOX # include <fstream.h> void main( ) {int n,m,a[20][20],i,j,x,y,p,q; ifstream f(date.txt) f>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=n;j++) a[i][j]=0; for(i=1;i<=m;i++) {f>>p>>q; a[p][q]=1; a[q][p]=1;} cout<<x=; cin>>x; cout<<y=;cin>>y; for(i=1;i<=n;i++) for(j=1;j<=n;j++) if((i==x)||(i==y)||(j==x)||(j==y)) a[i][j]=0; for (i=1; i<=n;i++) {for(j=1;j<=n;j++) cout<<a[i][j]<< ; cout<<endl;} f.close();} Bilet 27 C++ #include<iostream.h> void main() {int a,n,i ,pmin,pmax,s,v[100],max,min,x; ifstream f(in.txt); n=0; s=0; while(f>>x){n=n+1;v[n]=x;} min=v[1];max=v[1];pmin=1;pmax=1; for(i=1;i<=n;i++) {if(v[i]>max){max=v[i];pmax=i;} if(v[i]<min){min=v[i];pmin=i;} } if(pmin>pmax) {a=pmin;pmin=pmax;pmax=a;} for(i=pmin;i<=pmax;i++) s=s+v[i]; cout<<s=<<s; f.close(); } set century on clear use pers.dbf browse fields nume, adresa, telefon for data_ang>=gomonth(date(), -12) copy to sanctiuni.dbf for sanctionat >=gomonth(date(), -6) use sanctiuni.dbf browse if reccount()<=5 ?avem cel mult 5 articole else goto reccount()-4 delete rest *pack browse endif

Bilet 24 C++ FOX #include <iostream.h> int v[8],n; clear void tipar() use profesori.dbf {int I; browse for an_incadrare>2002 for(i=1;i<=n;i++) and an_incadrare<2006 {if(v[i]==1) cout<<do; browse for if(v[i]==2) cout<<re; an_incadrare<=year(date())-10 if(v[i]==3) cout<<mi; delete for salariu<523 if(v[i]==4) cout<<fa; *pack if(v[i]==5) cout<<sol; browse if(v[i]==6) cou```t<<la; if(v[i]==7) cout<<si; cout<<endl;} nr=nr+1; if(nr%10==0) cin.get();} int valid(int k) { int ok; ok=1; if((k>1)&&(v[k-1]==1&&v[k]==7||v[k-1]==7&&v[k]==1)) ok==0; if(k>1) && (v[k=1]==3&& v[k]==4 &&v[k]==3) ok=0; return ok; void BKT() {int k; k=1; v[k]=0; while(k>0) {while (v[k]<7) {v[k]=v[k]+1; if (valid(k)==1) if(k==n) tipar(); else{k=k+1; v[k]=0;} k=k-1;}} void main() {cout<<n<7; cin>>n; BKT();}

Bilet 25 C++ #include <iostream.h> struct elev {char nume[50]; int varsta; float media;}; elev v[50]; void main () {int n,I; cout<<n=;cin>>n; for(i=1;i<=n;i++) {cout<<numele:; cin>>v[i].nume; cout<<varsta:; cin>>v[i].varsta; cout<<media:; cin>>v[i].media;} for (i=1;i<=n;i++) if((v[i].varsta>17)&&(v[i].media<5 )) cout<<v[i].nume<<endl;}

FOX clear use premiu.dbf index on nume tag e browse fields nume, ,liceu, an for premiu=I and an=2006 select liceu,count(premiu)as nr_premiu from premiu.dbf where an>2004 and premiu+I; group by liceu; into dbf t1.dbf use t1.dbf calculate max (nr_premiu) to x browse for nr_premiu=x select an, count(premiu) as nr_premiu from premiu.dbf where premiu=I ; group by an; into dbf t2.dbf use t2.dbf calculate max(nr_premiu) to x browse for nr_premiu=x close all

FOX Dans.dbf Nume C(30) Editie N(4) Oras C(30) clear use dans.dbf index on nume tag e browse calculate(cnt()) to x for editie=1 ?Nr concurenti,x browse for oras=Targoviste

Bilet 26 C++ #include<iostream.h> struct elev {char nume[20]; int varsta; float media;}; elev v[20]; void main() {int n,i,j; cout<<n=;cin>>n; for(i=1;i<=n;i++) {cout<<numele elevului<<i<<:;cin>>v[i].nume; cout<<varsta elevului<<i<<:;cin>>>v[i].varsta; cout<<media elevului<<i<<:;cin>>v[i].media;} i=1; while(i<=n) if(v[i].media<5) for(j=1;j<=n-1;j++) v[j]=v[j+1]; n=n-1;} elsei=i+1; cout<<numar elemente in noua lista=<<n<<endl; for(i=1;i<=n;i+) cout<<v[i].nume<< <<v[i].varsta<< <<v[i].media<<endl; }

FOX Carti.dbf Titlu C(20) Autor C(20) An_aparitie N(4) Editura C(20) Pret N(3) Nr_inv N(10) clear use carti.dbf browse browse for nr_inv>14 and nr_inv<23 browse fields titlu,autor,editura for editura=LS-Informat

Bilet 28 C++ #include<fstream.h> struct complex{float a,b;} complex x; void main() {float Sr=0;Si=0; ifstream f(complex.txt) while(f>>x.a>>x.b) {Sr=Sr+x.a;Si=Si+x.b;} cout<<Sr<<+<<Si<<i; f.close(); }

FOX Film.dbf Cod_c C(3) Nume_f C(20) Actor_p C(30) Tip C(10) Regizor C(30) clear use film.dbf browse for actor_p=Richard Gere calculate cnt() to x for regizor=Sergiu Nicolaescu delete for tip=horror *pack browse

Bilet 29 C++ #include<iostream.h> void main() {int p,i,a,b,k,v[20],s,nr; cout<<p=;cin>>p; for(i=1;i<=p;i++) {cout<<v[<<i<<]=;cin>>v[i ];} cout<<a=;cin>>a; cout<<b=;cin>>b; cout<<k=;cin>>k; s=0; nr=0; for(i=1;i<=p;i++) if((v[i] %k==0)&&(v[i]>=a)&&(v[i]<= b)) {s=s+v[i]; nr=nr+1;} if(nr==0)cout<<Nu exista nr cu proprietatea ceruta; else cout<<Media aritmetica<<(float)s/nr; }

FOX Aeroport.dbf An N(4) Distanta N(4) Destinatie C(30) Nr_pasageri N(3) Firma C(20) clear use aeroport.dbf select an,count(an)as nr_zbor from aeroport.dbf; group by an; into dbf t1.dbf calculate max(nr_zbor) to x browse for nr_zbor=x use aeroport.dbf calculate max(distanta) to x for an=year(date()) ?distanta maxima,x calculate sum(nr_pasageri)for destinatie=Timisoaraand firma=TAROMand an=year(date())-1 to x ?Nr total pasageri,x

S-ar putea să vă placă și