Update test.cpp

This commit is contained in:
Nicky Mouha
2023-03-12 03:25:52 -04:00
committed by GitHub
parent 91a9a7eb32
commit 2477c3a1c2

View File

@@ -8,12 +8,12 @@ void test()
int a = getAnInt();
int b = getAnInt();
int c = getAnInt();
int x = getAnInt();
int x = getAnInt();
int y = getAnInt();
int d = getADouble();
int a1 = getAnUnsignedShort();
int b1 = getAnUnsignedShort();
int c1 = getAnUnsignedShort();
double d = getADouble();
unsigned short a1 = getAnUnsignedShort();
unsigned short b1 = getAnUnsignedShort();
unsigned short c1 = getAnUnsignedShort();
if (a+b>c) a = c-b; // BAD
if (a+b>c) { a = c-b; } // BAD
@@ -51,7 +51,7 @@ void test()
if (c<=b+a) a = c-b; // BAD
if (c<=b+a) { a = c-b; } // BAD
if (a+b>d) a = d-b; // GOOD
if (a+b>d) a = d-b; // BAD
if (a+(-x)>c) a = c-(-y); // GOOD
if (a+b>c) { b++; a = c-b; } // GOOD
if (a+d>c) a = c-d; // GOOD