tem.cpp: In function 'int main()':
tem.cpp:18:11: error: 'res' was not declared in this scope
int r=res;
^~~
tem.cpp:18:9: warning: unused variable 'r' [-Wunused-variable]
int r=res;
^
tem.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%i",&n);
~~~~~^~~~~~~~~
tem.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%i %i",&lo[i],&hi[i]);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~