1 / 8

Grupa II:

Aplicarea algoritmilor fundamentali in prelucrarea datelor. Grupa II: Cernoiu Theodor Croitoru Adriana Croitoru Ionuţ Dobrovie Robert Dogariu Alexandru Dogaru Florian. PROBLEMA. Se calculeaza numarul diagonalelor unui poligon cu n varfuri .

hadar
Download Presentation

Grupa II:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aplicareaalgoritmilorfundamentali in prelucrareadatelor Grupa II: Cernoiu TheodorCroitoru AdrianaCroitoruIonuţDobrovie RobertDogariuAlexandruDogaruFlorian

  2. PROBLEMA • Se calculeazanumaruldiagonalelorunuipoligon cu n varfuri. • Caz particular: Sa se calculezenumaruldiagonalelorunuipoligon cu 12 varfuri.

  3. Pentrurezolvaresuntnecesare: • TeorieMatematica: Combinari • TeorieInformatica : Instrucţiunea decizională • Turbo C++ 4.5 • Microsoft PowerPoint

  4. Combinari ,sau Asadar, formula calculariidiagonalelorunuipoligon cu n varfurieste: n*(n-3)/2

  5. Instrucţiunea decizională Acestă instrucţiune are următoarele douăvariante: • a)if(expresie) instr_a • b)if(expresie) instr_a else instr_f

  6. Codulsursa • #include<iostream.h> • void main() • { int nr, n • cout<<“numarul de varfuri=“; • cin>>n; if(n>2) • nr=(n*(n-3)/2); else cout<<“maiincearca”; Cout<<“numaruldiagonalelor =“<<nr; }

  7. Rezolvarecaz particular • n=12 => nr =12*(12-3)/2 nr = 54

  8. Echipa care a realizatacestproiect: Problema:Cernoiu Theodor Dogariu Alexandru Teoria Informatica:Croitoru Ionut Dobrovie Robert Teorie Matematica:Croitoru Adriana Dogaru Florian

More Related