Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Anonymous
unregistriert
Zitat von »"dot"«
![]()
C-/C++-Quelltext
1 ;
Zitat
Zitat
Inwiefern soll das Programm denn schwachsinnig sein?
Autsch, das wirf schlechtes Licht auf.
Das bezog sich nicht auf dein Programm, sondern auf die Aufgabenstellung!
Zitat
Titel: Schwachsinn als kunst
Zitat
Jedes Programm brauch eine Main Funktion.
Sheddex
unregistriert
![]() |
C-/C++-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#define SINNLOS1 int #define SINNLOS2 main #define SINNLOS3 (void) #define SINNLOS4 { #define SINNLOS5 SINNLOS: #define SINNLOS6 goto SINNLOS; #define SINNLOS7 return 0; #define SINNLOS8 } #define SINNLOS1UND2 SINNLOS1 SINNLOS2 #define SINNLOS3UND4 SINNLOS3 SINNLOS4 #define SINNLOS5UND6 SINNLOS5 SINNLOS6 #define SINNLOS7UND8 SINNLOS7 SINNLOS8 #define SINNLOS1UND2UND3UND4 SINNLOS1UND2 SINNLOS3UND4 #define SINNLOS5UND6UND7UND8 SINNLOS5UND6 SINNLOS7UND8 #define ALLESSINNLOSE SINNLOS1UND2UND3UND4 SINNLOS5UND6UND7UND8 //Das Programm ALLESSINNLOSE |
![]() |
C-/C++-Quelltext |
1 2 3 4 5 |
int main() { main(); return 0; } |
![]() |
C-/C++-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
__declspec( naked ) void doItBabe() { __asm pop eax //play it again, sam! doItBabe(); }; int main() { doItBabe(); return 0; } |
![]() |
C-/C++-Quelltext |
1 2 3 4 5 6 7 |
int main() { __asm __emit 0x0 __asm __emit 0x1 __asm __emit 0x2 __asm __emit 0x3 return 0; } |
Anonymous
unregistriert
![]() |
C-/C++-Quelltext |
1 2 3 |
#include <iostream.h> using namespace std; char* a; char *b; int main(void){cout<<"a eingeben: "; cin>>a; cout << endl << "b eingeben:"; cin>>b; cout<<endl<<"c"; cin.get(); return 0;} |
Sheddex
unregistriert
![]() |
C-/C++-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
#include <cmath> class KurzeZahl { public: void setzeWert(short x) { while(++wert != x); } void gibWert() const { throw wert; } void gibVorzeichen() const { if(!wert) throw static_cast<char>(wert); throw static_cast<char>(wert / sqrtf(static_cast<float>(wert * wert))); } void gibBetrag() const { try { gibVorzeichen(); } catch(char vz) { if(!vz) throw static_cast<short>(vz); float invVz = 1.0f / vz; throw static_cast<short>(invVz * wert); } } void operator + (const KurzeZahl& rhs) const { KurzeZahl ergebnis = *this; try { rhs.gibWert(); } catch(short w) { try { rhs.gibVorzeichen(); } catch(char vz) { while(vz ? (vz > 0 ? w-- : w++) : vz) { try { ergebnis.gibWert(); } catch(short t) { ergebnis.setzeWert(vz > 0 ? ++t : --t); } } } } throw ergebnis; } void operator - () const { KurzeZahl ergebnis = *this; float negiert = static_cast<float>(ergebnis.wert); reinterpret_cast<char*>(&negiert)[3] ^= 1 << 7; ergebnis.setzeWert(static_cast<short>(negiert)); throw ergebnis; } void operator - (const KurzeZahl& rhs) const { try { -rhs; } catch(KurzeZahl negiert) { *this + negiert; } } private: short wert; }; int main() { KurzeZahl a, b; a.setzeWert(13); b.setzeWert(29); try { a + b; } catch(KurzeZahl c) { try { c.gibWert(); } catch(short cw) { printf("13 + 29 = %d\n", cw); } } try { a - b; } catch(KurzeZahl c) { try { c.gibWert(); } catch(short cw) { printf("13 - 29 = %d\n", cw); } } return 0; } |
![]() |
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import java.util.Scanner; public class Katze { public static void main(String[] args) { Scanner scan = new Scanner(System.in); while(true) { System.out.print("Bitte geben sie eine Katze ein: "); String eingabe = scan.next(); try { Katze katze = (Katze) (Object) eingabe; } catch(Exception e) { System.out.println("Error, Sie haben keine Katze eingegeben"); } } } } |
Werbeanzeige