prog.cpp:15:5: error: use of undeclared identifier 'srand'
srand(time(NULL));
^
prog.cpp:16:9: error: use of undeclared identifier 'rand'
y = rand() % (b - a) + a; //генерируем y, где он будет равен остатку от деления на 98 (то есть от 0 до 98), но сдвинутый на 1 (то есть от 1 до 99)
^
prog.cpp:18:9: error: use of undeclared identifier 'rand'
z = rand() % (b - a) + a; //генерируем угадываемое число по тому же принципу
^
prog.cpp:19:9: error: use of undeclared identifier 'abs'; did you mean 'fabs'?
if (abs(x - z) < abs(y - z))
^~~
fabs
/usr/include/i386-linux-gnu/bits/mathcalls.h:181:14: note: 'fabs' declared here
__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
^
/usr/include/math.h:58:26: note: expanded from macro '__MATHCALLX'
__MATHDECLX (_Mdouble_,function,suffix, args, attrib)
^
/usr/include/math.h:60:22: note: expanded from macro '__MATHDECLX'
__MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
^
/usr/include/math.h:63:31: note: expanded from macro '__MATHDECL_1'
extern type __MATH_PRECNAME(function,suffix) args __THROW
^
/usr/include/math.h:66:42: note: expanded from macro '__MATH_PRECNAME'
#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
^
/usr/include/i386-linux-gnu/sys/cdefs.h:88:23: note: expanded from macro '__CONCAT'
#define __CONCAT(x,y) x ## y
^
prog.cpp:19:9: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
if (abs(x - z) < abs(y - z))
^
prog.cpp:19:9: note: use function 'std::abs' instead
if (abs(x - z) < abs(y - z))
^~~
std::abs
prog.cpp:19:9: note: include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
prog.cpp:19:22: error: use of undeclared identifier 'abs'; did you mean 'fabs'?
if (abs(x - z) < abs(y - z))
^~~
fabs
/usr/include/i386-linux-gnu/bits/mathcalls.h:181:14: note: 'fabs' declared here
__MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
^
/usr/include/math.h:58:26: note: expanded from macro '__MATHCALLX'
__MATHDECLX (_Mdouble_,function,suffix, args, attrib)
^
/usr/include/math.h:60:22: note: expanded from macro '__MATHDECLX'
__MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \
^
/usr/include/math.h:63:31: note: expanded from macro '__MATHDECL_1'
extern type __MATH_PRECNAME(function,suffix) args __THROW
^
/usr/include/math.h:66:42: note: expanded from macro '__MATH_PRECNAME'
#define __MATH_PRECNAME(name,r) __CONCAT(name,r)
^
/usr/include/i386-linux-gnu/sys/cdefs.h:88:23: note: expanded from macro '__CONCAT'
#define __CONCAT(x,y) x ## y
^
prog.cpp:19:22: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
if (abs(x - z) < abs(y - z))
^
prog.cpp:19:22: note: use function 'std::abs' instead
if (abs(x - z) < abs(y - z))
^~~
std::abs
prog.cpp:19:22: note: include the header <cstdlib> or explicitly provide a declaration for 'std::abs'
2 warnings and 5 errors generated.