Language: C++

#include <stdio.h>
#include <math.h>
char a[6],b[6];
int c,d;
int p;
int main(){
scanf("%d %d",&c,&d);
for(int t=0;t<5;t++){
a[t]=(c%(int)pow(10,5-t)-c%(int)pow(10,4-t))%(int)pow(4-t);
}
for(int t=0;t<5;t++){
b[t]=(d%(int)pow(10,5-t)-d%(int)pow(10,4-t))%(int)pow(4-t);
}
if(a[1]<a[3]||(a[1]==a[3]&&a[0]>a[4])){
for(int l=0;l<3;l++){
p=(int)a[0]*(int)pow(10,2-l)-1;
}
else{
for(int l=0;l<3;l++){
p=(int)a[0]*(int)pow(10,2-l);
}
}
if(b[1]<b[3]||(b[1]==b[3]&&b[0]>b[4])){
for(int l=0;l<3;l++){
p+=(int)b[0]*(int)pow(10,2-l)-1;
}
else{
for(int l=0;l<3;l++){
p+=(int)b[0]*(int)pow(10,2-l);
}
}
printf("%d",p);
return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:54: error: no matching function for call to 'pow(int)'
    9 | a[t]=(c%(int)pow(10,5-t)-c%(int)pow(10,4-t))%(int)pow(4-t);
      |                                                   ~~~^~~~~
In file included from /usr/include/c++/14/math.h:36,
                 from a.cc:2:
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided
a.cc:12:54: error: no matching function for call to 'pow(int)'
   12 | b[t]=(d%(int)pow(10,5-t)-d%(int)pow(10,4-t))%(int)pow(4-t);
      |                                                   ~~~^~~~~
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided
a.cc:18:1: error: expected '}' before 'else'
   18 | else{
      | ^~~~
a.cc:14:39: note: to match this '{'
   14 | if(a[1]<a[3]||(a[1]==a[3]&&a[0]>a[4])){
      |                                       ^
a.cc:27:1: error: expected '}' before 'else'
   27 | else{
      | ^~~~
a.cc:23:39: note: to match this '{'
   23 | if(b[1]<b[3]||(b[1]==b[3]&&b[0]>b[4])){
      |                                       ^