Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- int tablica[1,5,7,45,18,4,31,38,45,2,3,88,20,74,66]; // Opisz co chcesz zrobić w tej linijce na HO
- int lastSmallVal =tablica[1];
- int tmpArr[15]{}; //ukryta stała, takzwane magic number (antypattern)
- int it=0;
- // SORTOWANIE TABLICY:
- for(int i=0;i<15;i++) // ok, na razie robisz na stałej - gdybyś kiedyś musiał używać stałych używaj #define NAZWA <wartosc>...
- {
- for(int j=; j>=0;j--) // brak wartości początkowej j
- {
- it= tablica[i];
- if(tablica[i] < tablica[it++])
- {
- continue;
- }
- else
- { // problem z formatowaniem - czego uzywasz do pisania, vim? Polecam jakies CodeLite, Code::Blocks, netbeans++ albo lepiej skonfigurowane vim
- // rule of the thumb - choose CodeLite
- }
- }
- }
- return 0; // zmiana - nalezy podac return <wartosc_zwracana> - bo int main()...
- }// brakowalo domkniecia main. zawsze warto robic to tak budujac koniec-poczatek i tylko wstawiac rzeczy w klamry
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement