Code:
// Quadratzahlengenerator.cpp : Definiert den Einstiegspunkt für die Konsolenanwendung.
//
#include "stdafx.h"
#include <string>
#include <iostream>
#include <Windows.h>
#include <math.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int Quadrz ;
cout << endl ;
cout << "Menue: " << endl ;
cout << "Quadratzahlengenerator <1>" << endl ;
cout << "Formelanzeige <2>" << endl ;
cin >> Quadrz ;
Sleep (1000) ;
}
[color=#ff0000]switch[/color] (Quadrz) ;
[color=#ff0000]{[/color]
case 1:
int d ;
int x ;
int x2 ;
int y2 ;
cout << "Geben sie eine ungerade Zahl fuer d ein." << endl ;
cin >> d ;
x = (d - 1.0) / 2.0 ;
cout << " x ist gleich " << x << endl ;
Sleep (2500) ;
x2 = x * x ;
cout << "x^2 ist gleich " << x2 << endl ;
Sleep (2500) ;
y2 = x2 + d ;
cout << "y^2 ist gleich " << y2 << endl ;
Sleep (2500) ;
Sleep (2000) ;
getchar () ;
[color=#ff0000]break[/color] ;
[color=#ff0000]case[/color] 2:
cout << "Danke, das Sie sich für neue Funktionen entscheiden." << endl ;
[color=#ff0000]break[/color] ;
[color=#ff0000]default[/color]:
cout <<"Benutzen Sie bitte nur die Taste 1 und 2." << endl ;
}
{
getchar () ;
return () ;
}
Das Rote wird als falsch unterstrichen.






