#include <iostream>
#include <math.h>
double Funkcja(int x)
{
if (x < 0) throw "Liczba nie moze byc ujemna\n";
return sqrt(x);
}
int main()
{
int x{ 0 };
do
{
std::cin >> x;
try
{
std::cout << Funkcja(x) << std::endl;
}
catch (const char * s)
{
std::cout << s;
}
} while (x != 44);
}
Dlaczego gdy cin wczyta nie liczbę a literę to program się zapętla?