+ Reply to Thread
Results 1 to 7 of 7
  1. [programare] c/c++

    #1
    VIP ~TraNda~'s Avatar
    Member since
    Feb 2014
    Location
    WarGods
    Posts
    12,099
    Last username
    LiOn. ~JoK3r ~
    Blog Entries
    4
    Mentioned
    95 Post(s)
    Achievements Days Registered 4 Mentions Received 2 Mentions Received 1 Mentions Given 4 Mentions Given 3 Mentions Given 2 Mentions Given 1 Threads Rating Received 1
    Doneaza
    Sustine Comunitatea WarGods!
    Fii unul de-al nostru! Doneaza
    Doneaza in Cont Bancar
    Click aici pentru a face o Donatie

    Post [programare] c/c++

    C/C++

    * Algoritm

    - Algoritmul reprezinta rezolvarea etapizata, in pasi mici, elementari, a unei probleme.
    Scopul folosirii algoritmului este aplicarea lui la o serie pe probleme care au aceeasi metoda de rezolvare; adica, pentru orice dateale problemei, algortimul trebuie sa se incheie cu un raspuns.

    Un exemplu in acest sens este acuatia de gradul I. Exista o infinitate de ecuatii de gradul I dar toate se subscriu aceleiasi ecuatii generice A*X+B=0. Algoritmul trebuie sa rezolve aceasta ecuatie generica pentru a obtine rezultate corecte pentru intreaga clasa se ecuatii de gradul I sau sa anunte eroarea in cazul in care simbolul A ar avea valoarea 0.

    - Caracteristici
    Deducem de aici o serie de proprietati pe care un algoritm corect trebuie sa le indeplineasca:
    • sa aiba caracter de generalitate: sa rezolve o intreaga clasa de probleme de acelasi gen (pentru orice date de intrare) .
    • sa aiba finitudine: sa ofere un raspuns la problema si sa se incheie in timp util.
    • sa fie clar: calculul/etapele sa fie descriese intr-o maniera fara dubii.

    DATE DE INTRARE -> ALGORITM -> DATE DE IESIRE

    - Reprezentarea algoritmilor
    1. secventa : pasii sa se execute unul dupa altul.
    1. testul : in cazul in care rezolvarea trebuie sa raspunda unei intrebari sa putem aplege traseul logic ce trebuie urmat
    2. repetitia : sa putem repeta o anumita secventa daca algoritmul o cere
    De asemeni, pentru exprimarea algoritmilor s-au incercat metode care sa poata fi intelese de toti. Iata cateve dintre ele:
    • scheme logice: metoda grafica care specifica traseul ce trebuie urmat
    • pseudocod: un set de reguli de scriere , in principiu in limba engleza; pt elevi s-a simplificat, folosindu-se aceleasi notatii si limba romana
    • limbaj de programare: mult mai strict ca exprimare dar folosind aceleasi concepte.

    ** C++
    - C++ (pronunțat „C plus plus„) este un limbaj de programare general, compilat. Este un limbaj multi-paradigmă, cu verificarea statică a tipului variabilelor ce suportă programare procedurală, abstractizare a datelor, programare orientată pe obiecte. În anii 1990, C++ a devenit unul din cele mai populare limbaje de programare comerciale, rămânând astfel până azi. Succesul extraordinar pe care il are limbajul C++ a fost asigurat de faptul ca a extins cel mai popular limbaj al momentului, C. Programele scrise in C functioneaza si in C++, si ele pot fi transformate in C++ cu eforturi minime.
    - INSTRUCTIUNI
    1. Instructiunea compusa
      -
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      Unde instr 1, instr 2, ..., instr n pot fi oricare dintre instructiunile limbajului de programare
    2. Instructiunea de atribuire
      -
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      Unde "=" se numeste operator de atribuire.
      Modul de executie:
      -> se evalueaza expresia aflata la dreapta semnului de atribuire si rezultatul obtinut este memorat in variabila aflata la stanga semnului de atribuire.
      OBS!
      Variabila si expresia utilizata in cadrul unei instructiuni de atribuire trebuie sa aibe acelasi tip de date sau sa fie de tipuri compatibile de date.
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      + => adunare.
      - => scadere.
      / => DIV. (partea intreaga a unui numar impartit la alt numar. Ex : 1234 / 10 = 123 [1234 impartit la 10 ne da 123,4 , deci ne va da 123!])
      % => MOD. (partea zecimala a unui numar impartit la alt numar. Ex : 1234 % 10 = 4 [1234 impartit la 10 ne da 123,4 , deci ne va da 4!])
      == => Verifica daca doua variabile sunt egale.
    3. Instructiunea de citire
      - OBS!
      Functiile pentru citirea si afisare datelor se afla in biblioteca iostream (#include <iostream>)
      Atunci cand un program utilizeaza cel putin o instructiune de citire sau afisare programul trebuie sa contina in mod obligatoriu in sectiunea de declarare biblioteci linia: #include <iostream>
      Forma generala a instructiunii de citire este urmatoarea:
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      Instructiunea de citire se efectueaza astfel:
      - se intrerupe executia programului si se asteapta introducerea unui nr de valori "=" cu numarul variabilelor aflate in cadrul instructiunii cin.
      - valorile introduse sunt memorate pe rand in variabila din linia de instr.
      OBS!
      Valorile introduse trebuie sa fie de acelasi tip de date ca si tipurile de date aflate in cadrul instructiunii de citire.
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    4. Instructiunea de scriere
      -
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      Modul de executie:
      - se evalueaza expresiile care apar in cadrul liniei de instr. si valorile obtinute se afiseaza pe ecran.
      In cadrul unei instrucituni cout se pot afisa si caractere sau siruri de caractere. In limbajul C++ se reprezinta incadrate intre apostrofuri, iar sirurile de caractere se reprezinta intre ghilimele.
      Ex: Se citesc de la tastatura 2 nr intregi a si b. Scrieti un program care afiseaza suma si produsul celor 2 nr.
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      In cadrul instructiunii cout pot sa apara endl care realizeaza saltul la linie noua a cursorului.
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    5. Instructiunea de decizie
      -
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      Modul de executie:
      - se evalueaza expresia si daca aceasta este diferita de 0 se efectueaza instructiunea 1.
      - in cazul in care valoarea expresiei este egala cu 0 atunci:
      a) daca instructiunea if este in forma a) se efectueaza instructiunea 2.
      b) daca instructiunea if este in forma b) atunci se executa instructiunea care urmeaza in cadrul algoritmului dupa instructiunea de decizie.
      Ex: Se citesc 2 nr intrgi a si b. Scriei un program C++ care afiseaza valoarea maxima dintre cele 2 nr citite.
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    6. Instructiunea repetitiva cu nr cunoscut de pasi(for)
      -
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      Modul de executie:
      - se efectueaza expresia de initializare si se valueaza expresia de test. Dca rezultatul expresiei de test este diferit de 0(adica este adevarata) se efectueaza instructiunea subordonata instructiunii for.
      - dupa efectuarea instructiunii subordonate se efectueaza expresia de incrementare sau de decrementare, si se evalueaza din nou expresia de test. Daca valoarea acesteia este diferita de 0 se efectueaza din nou instructiunea subordonata secventii for si se efectueaza expresia de incrementare sau de decrementare.
      - algoritmul se continua pana cand valoarea expresiei de test este egala cu 0(este falsa).
      OBS!
      Instructiunea subordonata secventei for poate fi instructiune simpla sau compusa.
      Ex: Se citeste n nr nat. Scrieti un prgram care calculeaza suma primelor n nr naturale.
      S=1+2+3+...+n, n∈N
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    7. Instructiunea repetitiva cu test initial(while)
      -
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      Modul de executie:
      - se evalueaza expresia si daca aceasta este diferita de 0 se efectueaza instructiunea subordonata. Dupa efectuarea instructiunii se evalueaza din nou expresia si daca aceasta este diferita de 0 se efectueaza din nou instructiunea subordonata. Algoritmul se reia cat timp valoarea expresiei este diferita de 0.
      - in cazul in care valoarea expresiei este egala cu 0, se termina de efectuat instructiunea while si se efectueaza instructiunea care urmeaza in cadrul programului dupa instructiunea while.
      Ex:
      n∈N
      S=1+2+...+n.
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    8. Instructiunea repetitiva cu test final(do-while)
      -
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
      ;
      Modul de executie:
      - se efectueaza instructiunea subordonata si apoi se evalueaza expresia, daca expresia este diferita de 0 atunci se efectueaza din nou instructiunea subordonata.
      - dupa efectuarea instructiunii se evalueaza din nou expresia, algoritmul reluandu-se cat timp expresia este diferita de 0.
      - in cazul in care valoarea expresiei este egala cu 0 se termina de efectuat instructiunea do-while si se executa instructiunea care urmeaza in cadrul programului dupa aceasta.
      Ex:
      n∈N
      S=1+2+...+n;
      Code:
      You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!

    Puteti lucra in CodeBlocks. Se gaseste foarte usor pe internet.
    Link Download CodeBlocks : You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!

    Puteti incerca prima porblema mai usoara :
    Se da un numar n natural. Sa se calculeze si sa se afiseze pe ecra suna cifrelor numarului n.
    Code:
    You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    }
    Exemplu :
    n = 1234
    s = 0
    Verifica daca n este mai mare ca 0 (este) , s devine 0 + 4 . n devine 123 . Verifica daca n este mai mare ca 0 (este), s devine 4 + 3 . n devine 12 . Verifica daca n este mai mare ca 0 (este) , s devine 7 + 2. n devine 1 . Verifica daca n este mai mare ca 0 (este) , s devine 9 + 1. n devine 0 . Verifica daca n este mai mare ca 0 (nu este) . Ciclul s-a oprit. Se afiseaza pe ecran s=10

    Sper ca va este de folos . Accept orice fel de critica .
    Last edited by ~TraNda~; 16-07-2015 at 05:31 AM.
    -------------

    TraNda - WarGods | R.R.M - AngeL - LiOn. - pichacku - Jok3r - UnicA

    P A C E

    DISCORD: unknown.cfg

    Thanks Pop Alexandra, Dark][Knight™ a dat Thanks acetui post
    Like WarGods | KGB, ~Wolf~, Dark][Knight™ a dat Like acetui post

  2. [programare] c/c++

    #2
    Banned Pop Alexandra's Avatar
    Member since
    Mar 2017
    Location
    Cluj-Napoca, Romania
    Posts
    3
    Mentioned
    0 Post(s)
    Achievements Days Since Last Visited 1 Days Registered 2 Days Registered 1
    Multumesc! Foarte usor de urmarit pasii. Java sau Python stii?
    _________________________________
    Last edited by ~TraNda~; 19-07-2017 at 04:47 AM.
    Like ~TraNda~ a dat Like acetui post

  3. [programare] c/c++

    #3
    VIP ~TraNda~'s Avatar
    Member since
    Feb 2014
    Location
    WarGods
    Posts
    12,099
    Last username
    LiOn. ~JoK3r ~
    Blog Entries
    4
    Mentioned
    95 Post(s)
    Achievements Days Registered 4 Mentions Received 2 Mentions Received 1 Mentions Given 4 Mentions Given 3 Mentions Given 2 Mentions Given 1 Threads Rating Received 1
    Doneaza
    Sustine Comunitatea WarGods!
    Fii unul de-al nostru! Doneaza
    Doneaza in Cont Bancar
    Click aici pentru a face o Donatie

    Quote Originally Posted by Pop Alexandra You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    Multumesc! Foarte usor de urmarit pasii. Java sau Python stii?
    Nu am studiat niciunul dintre cele doua limbaje de programare mentionate de tine mai sus, dar nu e greu de studiat
    -------------

    TraNda - WarGods | R.R.M - AngeL - LiOn. - pichacku - Jok3r - UnicA

    P A C E

    DISCORD: unknown.cfg


  4. [programare] c/c++

    #4
    Moderator:
    Programare
    ~Wolf~'s Avatar
    Member since
    Jan 2017
    Location
    Dark abyss
    Posts
    3,078
    Last username
    GaBiTzU M@riju@n@ |Wolf| WarGods | Wolf
    Mentioned
    39 Post(s)
    Achievements Visitor Messages Given 1 Days Registered 3 Mentions Received 1 Mentions Given 2 Mentions Given 1 Visitor Messages Received 2 Visitor Messages Received 1 Total Posts 3
    Doneaza
    Sustine Comunitatea WarGods!
    Fii unul de-al nostru! Doneaza
    Doneaza in Cont Bancar
    Click aici pentru a face o Donatie

    Opinii:
    1.Foarte interesant asta.Am citit tot chiar dacă nu îmi plac programările.
    2. Puțină curiozitate:la ce folosește și în ce program se fac astea(notepad, etc. )?

    Critici:
    1. Mici greșeli gramaticale, dar probabil erai obosit

    Întrebare bonus(te rog să mă ajuți)
    Mereu când intru pe internet, după ce accesez un site îmi apare câte o filă, chiar și porno fără să o accesez. Cum pot scăpa de ele, să nu îmi mai apară(AdBlock nu funcțiojează, e filă nu pop-up)
    Thanks ~TraNda~ a dat Thanks acetui post

  5. [programare] c/c++

    #5
    VIP ~TraNda~'s Avatar
    Member since
    Feb 2014
    Location
    WarGods
    Posts
    12,099
    Last username
    LiOn. ~JoK3r ~
    Blog Entries
    4
    Mentioned
    95 Post(s)
    Achievements Days Registered 4 Mentions Received 2 Mentions Received 1 Mentions Given 4 Mentions Given 3 Mentions Given 2 Mentions Given 1 Threads Rating Received 1
    Doneaza
    Sustine Comunitatea WarGods!
    Fii unul de-al nostru! Doneaza
    Doneaza in Cont Bancar
    Click aici pentru a face o Donatie

    Quote Originally Posted by M@riju@n@ You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    2. Puțină curiozitate:la ce folosește și în ce program se fac astea(notepad, etc. )?
    Este un limbaj de programare folosit in dezvoltarea aplicatiilor, soft-urilor, jocurilor etc. Aces limbaj se scrie in program ca: codeblocks, mingw etc.

    Quote Originally Posted by M@riju@n@ You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    Mereu când intru pe internet, după ce accesez un site îmi apare câte o filă, chiar și porno fără să o accesez. Cum pot scăpa de ele, să nu îmi mai apară(AdBlock nu funcțiojează, e filă nu pop-up)
    Sunt link-uri de redirectare. Cand dai chiar si un click pe pagina, fara sa fie vreun buton sau ceva scris te redirecteaza pe un alt site. Din cate stiu eu (sincer nici nu prea m-am interesat de acest subiect) nu poti face nimic, doar sa dai X. Il invit pe Tiger, daca cunoaste vreo metoda sa ne-o comunice si noua.
    -------------

    TraNda - WarGods | R.R.M - AngeL - LiOn. - pichacku - Jok3r - UnicA

    P A C E

    DISCORD: unknown.cfg

    Thanks ~Wolf~ a dat Thanks acetui post
    Like WarGods | KGB, ~Wolf~ a dat Like acetui post

  6. [programare] c/c++

    #6
    Banned DarkRed's Avatar
    Member since
    Dec 2013
    Location
    Pitesti
    Posts
    728
    Last username
    Justice01 TITAN Tetrahidrocanabinol
    Mentioned
    0 Post(s)
    Achievements Total Posts 2 Total Posts 1 Days Since Last Visited 2 Days Since Last Visited 1 Days Registered 3 Days Registered 2 Days Registered 1 Threads 2
    Quote Originally Posted by M@riju@n@ You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    Opinii:
    Întrebare bonus(te rog să mă ajuți)
    Mereu când intru pe internet, după ce accesez un site îmi apare câte o filă, chiar și porno fără să o accesez. Cum pot scăpa de ele, să nu îmi mai apară(AdBlock nu funcțiojează, e filă nu pop-up)
    Paginile POP-up nu-ti apar fara sa fi facut ceva.
    Cel mai probabil ai dat click pe o reclama (ruleta unde castigi ceva, etc).
    Iti recomand sa folosesti un anti-virus, daca nu funcioneaza ar cam trebui sa reinstalezi windows-ul.
    Sau ai putea sa folosesti un Popup BLOCKER (You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account! ) .

    EDIT
    Alt software pentru a bloca Popup-urile: You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!
    Last edited by DarkRed; 26-03-2017 at 04:44 PM.
    Thanks ~Wolf~ a dat Thanks acetui post
    Like WarGods | KGB, ~Wolf~, roby313 a dat Like acetui post

  7. [programare] c/c++

    #7
    VIP ~TraNda~'s Avatar
    Member since
    Feb 2014
    Location
    WarGods
    Posts
    12,099
    Last username
    LiOn. ~JoK3r ~
    Blog Entries
    4
    Mentioned
    95 Post(s)
    Achievements Days Registered 4 Mentions Received 2 Mentions Received 1 Mentions Given 4 Mentions Given 3 Mentions Given 2 Mentions Given 1 Threads Rating Received 1
    Doneaza
    Sustine Comunitatea WarGods!
    Fii unul de-al nostru! Doneaza
    Doneaza in Cont Bancar
    Click aici pentru a face o Donatie

    @DarkRed:
    Quote Originally Posted by M@riju@n@ You have to register to be able to see this link. Register HERE! If you are already a member please log in! If you still you are not able to see the link you need to activate your account or an administrator need to activate your account!

    Întrebare bonus(te rog să mă ajuți)
    Mereu când intru pe internet, după ce accesez un site îmi apare câte o filă, chiar și porno fără să o accesez. Cum pot scăpa de ele, să nu îmi mai apară(AdBlock nu funcțiojează, e filă
    nu pop-up
    )
    -------------

    TraNda - WarGods | R.R.M - AngeL - LiOn. - pichacku - Jok3r - UnicA

    P A C E

    DISCORD: unknown.cfg

    Thanks ~Wolf~ a dat Thanks acetui post
    Like WarGods | KGB, ~Wolf~ a dat Like acetui post

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Partners
Humble Monthly Bundle
Voucher PC-Garage