trojanxem
Użytkownik
- Dołączył
- Grudzień 6, 2011
- Posty
- 239
i pytanie czemu odrazu program sie otwiera i zamyka co zrobiłem źle?
#include <cstdio>
using namespace std;
int main() // Kalkulator by Troyaax 0.1
{
int a;
int b;
int c;
int r;
int h;
int pi = 3.14;
int liczba;
int d;
int e;
int g;
printf("Witaj w kalulatorze by Bartek 0.1, menu: \n");
printf("1: Kwadrat\n");
printf("2: Prostokat\n");
printf("3: Trojkat \n");
printf("4: Okrag \n");
switch (liczba)
{ case 1: //Kwadrat
printf("Podaj bok a\n");
scanf("%d", &a);
printf("Podaj bok b\n");
scanf("%d", &b);
printf("Pole to %d , a obwod to %d\n", a*a, 4*a;
break;
case 2: //Prostokat
printf("Podaj bok a\n");
scanf("%d", &a);
printf("Podaj bok b\n");
scanf("%d", &b);
printf("Pole to %d, a obwod to %d\n", a*b, 2*a+2*b); break;
case 3: //Trojkat
printf("Podaj podstawe \n");
scanf("%d", &a);
printf("Podaj wysokosc \n");
scanf("%d", &h);
printf("Podaj ramie\n");
scanf("%d", &d);
printf("Podaj drugie ramie\n");
scanf("%d", &e);
printf("Pole to %d, a obwod to %d\n", a*0.5*h, a+d+e);
case 4: // Okrag
printf("Podaj promien\n");
scanf("%d", &r);
printf("Twoje pole to %d, a obwod to %d\n", 2*pi*r, pi*r^2);
}
return 0;
}