# fisiere1.pdf

Description
Probleme rezolvate 1. Sa se scrie un program care afiseaza lungimea celei mai lungi linii din fisierul text TEST: /*------------------------------------------------*/ /* */ /* afiseaza lungimea lg_max a celei mai lungi */ /* linii a fisierului */ /* */ /*------------------------------------------------*/ #include void main(void) { FILE *f; char

View again

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information
Category:

## Documents

Publish on:

Views: 2 | Pages: 4

Share
Transcript
Probleme rezolvate 1. Sa se scrie un program care afiseaza lungimea celei mai lungi linii din fisierul text TEST: /**//**//*afiseazalungimealgRmaxaceleimailungi*//*liniiafisierului*//**//**/includestdio.UVvoidmainWvoidXYZ[\E*f]cUarc]intlgRmax^lgRcurenta]lgRmax_lgRcurenta_]ifWWf_fopenWTEST^rXXXYputsWZisierulTESTnupoatefidescUisX]return]UileWWc_getcWfXX_EZXifWc__hnhXYifWlgRmaxlgRcurentaXlgRmax_lgRcurenta]lgRcurenta_]elselgRcurentakk]fcloseWfX]printfWn\iniaceamailungaarelungimead^lgRmaxX] .Sa se scrie un program care copiaza un fisier binar sursa n alt fisier binar destinatie. /**//**//*copiazacontinutulunuifisierbinar*//*inaltfisierbinar*//**//*/includestdio.UVvoidmainWvoidXYZ[\E*fs^*fd]cUarc]ifWWfs_fopenWsursa^rbXX__q\\XYfprintfWstderr^ZisierulsursanupoatefidescUisnX]return]  ifWWfd_fopenWdest^bXX__q\\XYfprintfWstderr^ZisieruldestnupoatefidescUisnX]return]c_getcWfsX]UileWfeofWfsXXYputcWc^fdX]c_getcWfsX]fcloseWfsX]fcloseWfdX] .Sa se realizeze un program care pastreaza evidenta unei grupe de studenti. atele despre studentiWnumele^ vrsta^ mediaX se pastreaza sub forma unui fisier text. Programul trebuie sa permita urmatoareleoptiuni: o  a^   adaugarea unui nou student n fisier] o  l^ \  listarea datelor tuturor studentilor] o  m^   modificarea datelor unui student] o  x^ w  terminarea programului] /**//**//*evidentauneigrupedestudenti*//**//**/includestdio.UVincludeconio.UVincludectpe.UVincludestdlib.UVincludestring.UVdefine\qE/*lungimeamaximaanumelor*/tpedefstructYcUarnumey\qE]intvarsta]floatmedie]student]cUarfisiery1]/*numelefisierului*//**//**//*adaugadateleunuinoustudentinfisier*//**//*/voiddaugStudentWvoidXYZ[\E*f]students]  ifWWf_fopenWfisier^atXXXYputsWnZisierulnupoatefidescUis.X]return]printfWnumele^varsta^media:X]scanfWsdf^s.nume^{s.varsta^{s.medieX]fflusUWstdinX]/*segolestebufferultastaturii*/fprintfWf^sd|.fn^s.nume^s.varsta^s.medieX]fcloseWfX]/**//**//*afiseazadateletuturorstudentilor*//**//**/void\istezStudentiWvoidXYZ[\E*f]students]ifWWf_fopenWfisier^rtXXXYputsWnZisierulnupoatefidescUis.X]return]UileWfscanfWf^sdf^s.nume^{s.varsta^{s.medieX_EZXprintfWnsd|.fn^s.nume^s.varsta^s.medieX]fcloseWfX]/**//**//*modificadatelestudentului*//*alcaruinumesecitesteinvariabilan*//**//**/voidodificStudentWvoidXYintgasit_]Z[\E*f]students]cUarny\qE]/*numelestudentuluiale*//*caruidatesevormodifica*/ifWWf_fopenWfisier^rktXXXYputsWZisierulnupoatefidescUis.X]return]printfWnumestudent:X]fgetsWn^\qE^stdinX]UileWfscanfWf^sdf^s.nume^{s.varsta^{s.medieX_EZXifWstrcmpWn^s.numeXXY/*studentulafostgasit^seafiseazadatelesale*/  printfWsd|.fn^s.nume^s.varsta^s.medieX]gasit_1]brea}]ifWgasitXprintfWnStudentulsnuexistainfisier.^nX]elseYprintfWnumele^varsta^media:X]scanfWsdf^s.nume^{s.varsta^{s.medieX]fflusUWstdinX]/*pozitionarelainceputulinregistrarii*/fsee}Wf^^SEE~Rãq€X]fprintfWf^sd|.fn^s.nume^s.varsta^s.medieX]fcloseWfX]/**//**//*afiseazameniulprogramului*//**//**/voidfisezeniuWvoidXYputsWna^adaugarestudentX]putsWm^modificaredatestudentX]putsWl^\listarestudentiX]putsWx^wparasireprogramX]voidmainWvoidXYcUaropt]putsWumefisier:X]fgetsWfisier^1^stdinX]UileW1XYfisezeniuWX]opt_toloerWgetcUeWXX]sitcUWoptXYcasehah:daugStudentWX]brea}]casehmh:odificStudentWX]brea}]casehlh:\istezStudentiWX]brea}]casehxh:exitWX]default:putsWãomandaeronatanX]
Related Search
Similar documents

### fisiere1.pdf

View more...

#### مبادرة النموذج الاداري السوري الياسمين الدمشقي

We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks