Zum Inhalt springen

EggL

Mitglieder
  • Gesamte Inhalte

    2
  • Benutzer seit

  • Letzter Besuch

  1. Hi! Also das mit dem Bubblesort stimmt nicht ganz weil bei nem Bubblesort beide Array-"Schubladen" weitergehen und bei diesem wird immer die 1. in einem Durchgang behandelt und wandert erst weiter wenn alle anderen durch sind ... Ja die Kleinigkeiten hab ich beseitigt, aber das was Idexe meinte find ich ne gute Idee nur dies zu realisieren gelingt mir nicht. Kann da vllt jemand helfen ? THX! GreeTzzZ EggL
  2. Hi! Also ich mache ne Ausbildung zum ITA und da haben wir natürlich auch Programmieren. Wir arbeiten im Moment mit Borland C++ und erstellen Konsolenprogramme. Nun haben wir heute die Aufgabe bekommen ein Programm zu optimieren. Also ich bin der beste bei uns im Kurs und habe das Muster hier auch geschrieben, aber wie ich das jez noch, mit unserem Wissen, optimieren soll weiß ich nich. Wäre super wenn mir jemand helfen könnte! #include<iostream.h> #include<dos.h> #define ANZ 8 void eingaben(int[]); void sort(int[]); void ausgabe(int[]); int main() { int eingabe[ANZ]; char trash; system("color 02"); cout <<" b "<< endl; cout <<" b "<< endl; cout <<" bbb y y "<< endl; cout <<" b bb yy "<< endl; cout <<" bbb y "<< endl; cout <<" EEEEEE y LL "<< endl; cout <<" EE LL "<< endl; cout <<" EE gggggg gggggg LL "<< endl; cout <<" EEEEE gg gg gg gg LL "<< endl; cout <<" EE gg gg gg gg LL "<< endl; cout <<" EE gg gg gg gg LL "<< endl; cout <<" EE gg gg gg gg LL "<< endl; cout <<" EEEEEE gggggg gggggg LLLLLL "<< endl; cout <<" gg gg "<< endl; cout <<" gggggg gggggg "<< endl; cout << endl; cout << endl; cout << endl; cout << "Bitte geben sie " << ANZ << " Zahlen ihrer Wahl ein:" << endl; eingaben(eingabe); sort(eingabe); cout << endl << "So lauten die von ihnen eingegebenen Zahlen in Reihenfolge:" << endl; ausgabe(eingabe); cin >> trash; } void eingaben(int eingabe[]) { int i; for(i=0;i<ANZ;i++) { cin >> eingabe[i]; cout << endl; } } void sort(int eingabe[]) { int i=0,j,z; for(;i<ANZ-1;) { j=i+1; while(j<ANZ) { if(eingabe[i]<eingabe[j]) ; else { z=eingabe[i]; eingabe[i]=eingabe[j]; eingabe[j]=z; } j++; } i++; } } void ausgabe(int eingabe[]) { int i; for(i=0;i<ANZ;i++) cout << eingabe[i] << endl; } THX! GreeTzzZ EggL

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...