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; <span class="style_type">int</span> main<span class="style_symbol">(</span><span class="style_symbol">)</span> <span class="style_symbol">{</span> bool winter <span class="style_symbol">=</span> <span class="style_constant">false</span>; char auswahl<span class="style_symbol">,</span> typ; cin >> auswahl >> typ; <span class="style_keyword">switch</span> <span class="style_symbol">(</span>auswahl<span class="style_symbol">)</span> <span class="style_symbol">{</span> <span class="style_keyword">case</span> 'M': cout << <span class="style_string">"Motor"</span> << flush; <span class="style_keyword">case</span> 'S': cout << <span class="style_string">"Segel"</span> << flush; <span class="style_keyword">case</span> 'B': cout << <span class="style_string">"Boot"</span> << flush; default: <span class="style_keyword">if</span><span class="style_symbol">(</span>winter<span class="style_symbol">)</span><span class="style_symbol">{</span> <span class="style_keyword">if</span><span class="style_symbol">(</span>typ <span class="style_symbol">=</span><span class="style_symbol">=</span> <span class="style_int">'S'</span><span class="style_symbol">)</span> cout << <span class="style_string">"mitGPS"</span> << endl; <span class="style_keyword">else</span> cout << <span class="style_string">"ohneGPS"</span> << endl;<span class="style_symbol">}</span> <span class="style_symbol">}</span> <span class="style_keyword">return</span> <span class="style_int">0</span>; <span class="style_symbol">}</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; }