Witam.
Mam klopot z zadaniem 6441. Mianowicie moj kod dziala w codebloksie jednak po zgloszeniu wyswietla mi sie błąd wykonania (SIGABRT).
Z gory dzieki za pomoc.
#include
#include
#include
using namespace std;
int test;
int a,b,c,d;
double e,f;
int l = new int[test4];
int dluzszy (int x,int y);
int krotki (int x,int y);
double przekatna(double x,double y);
double maleT (double x);
int main()
{
cin >> test;
for (int i=0;i<=(test*4)-1; i++)
{
cin >> l[i];
}
system("cls");
for (int i=0;i<=test-1;i++)
{
a=dluzszy (l[0+(i*4)],l[1+(i*4)]);
b=krotki (l[0+(i*4)],l[1+(i*4)]);
c=dluzszy (l[2+(i*4)],l[3+(i*4)]);
d=krotki (l[2+(i*4)],l[3+(i*4)]);
e=przekatna (l[0+(i*4)],l[1+(i*4)]);
f=maleT(d);
if ((c<e)&&sqrt(pow((a-f),2)+pow((b-2*f),2))>c)
{
cout << "TAK" << endl;
}
else
{
cout << "NIE" << endl;
}
}
delete [] l;
return 0;
}
int dluzszy (int x,int y)
{
if (x>=y)
return (x);
else if (y>x)
return (y);
}
int krotki (int x,int y)
{
if (x<=y)
return (x);
else if (y<x)
return (y);
}
double przekatna(double x,double y)
{
return (sqrt(pow(x,2)+pow(x,2)));
}
double maleT (double x)
{
return (x/sqrt(5));
}