Skip to content
Home
Post Code
Jass (Warcraft III)
Wurst
GUI (Warcraft III)
Galaxy (StarCraft II)
GUI (StarCraft II)
C++
Java
Delphi
Text
Search Code
Compare Code
Uploads
Draw
Create New Drawing
View Drawings
Graph
Log in
<pre class="jasscode">#include <iostream> using namespace std; int main() <span class="style_comment">{</span> <span class="style_comment"> bool winter = false;</span> <span class="style_comment"> char auswahl, typ;</span> <span class="style_comment"> cin >> auswahl >> typ;</span> <span class="style_comment"> switch (auswahl) {</span> <span class="style_comment"> case 'M':</span> <span class="style_comment"> cout << "Motor" << flush;</span> <span class="style_comment"> case</span> <span class="style_comment"> 'S':</span> <span class="style_comment"> cout << "Segel" << flush;</span> <span class="style_comment"> case</span> <span class="style_comment"> 'B':</span> <span class="style_comment"> cout << "Boot" << flush;</span> <span class="style_comment"> default:</span> <span class="style_comment"> if(winter){</span> <span class="style_comment"> if(typ == 'S'){</span> <span class="style_comment"> cout << "mitGPS" << endl;</span> <span class="style_comment"> }</span> <span class="style_keyword">else</span> cout << <span class="style_string">"ohneGPS"</span> << endl; } } return <span class="style_int">0</span>; } </pre>
select language
jass
java
> delphi
C++
php
GSL
galaxy
visualBasic
wurst
Text
Markdown
select style
default
bbcode - default
Jasscraft
> jasscraft html
visual
lightweight
lightweightNr
goto line:
Compare with:
text copy window
edit this code
post new code
#include <iostream> using namespace std; int main() { bool winter = false; char auswahl, typ; cin >> auswahl >> typ; switch (auswahl) { case 'M': cout << "Motor" << flush; case 'S': cout << "Segel" << flush; case 'B': cout << "Boot" << flush; default: if(winter){ if(typ == 'S'){ cout << "mitGPS" << endl; } else cout << "ohneGPS" << endl; } } return 0; }