Language: C

int main(){
  scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
  if (x < y){
    subf(a,b,c,x,y);
  }else{
    subf(a,b,c,y,x);
  }
  printf("%d",sum);
  return 0;
}

int subf(){
  if (a+b < 2*c){
    sum += (a+b)*x;
    if (b < 2*c){
      sum += b*(y-x);
    }else{
      sum += 2*c*(y-x);
    }
  }else{
    sum += 2*c*x;
    if (b < 2*c){
      sum += b*(y-x);
    }else{
      sum += 2*c*(y-x);
    }
  }
  return sum;
}


Compiler output:
main.c: In function 'main':
main.c:2:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 |   scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:2:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 |   scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
      |   ^~~~~
main.c:2:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:23: error: 'a' undeclared (first use in this function)
    2 |   scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
      |                       ^
main.c:2:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:2:26: error: 'b' undeclared (first use in this function)
    2 |   scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
      |                          ^
main.c:2:29: error: 'c' undeclared (first use in this function)
    2 |   scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
      |                             ^
main.c:2:32: error: 'x' undeclared (first use in this function)
    2 |   scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
      |                                ^
main.c:2:35: error: 'y' undeclared (first use in this function)
    2 |   scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
      |                                   ^
main.c:4:5: error: implicit declaration of function 'subf' [-Wimplicit-function-declaration]
    4 |     subf(a,b,c,x,y);
      |     ^~~~
main.c:8:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |   printf("%d",sum);
      |   ^~~~~~
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:15: error: 'sum' undeclared (first use in this function)
    8 |   printf("%d",sum);
      |               ^~~
main.c: In function 'subf':
main.c:13:7: error: 'a' undeclared (first use in this function)
   13 |   if (a+b < 2*c){
      |       ^
main.c:13:9: error: 'b' undeclared (first use in this function)
   13 |   if (a+b < 2*c){
      |         ^
main.c:13:15: error: 'c' undeclared (first use in this function)
   13 |   if (a+b < 2*c){
      |               ^
main.c:14:5: error: 'sum' undeclared (first use in this function)
   14 |     sum += (a+b)*x;
      |     ^~~
main.c:14:18: error: 'x' undeclared (first use in this function)
   14 |     sum += (a+b)*x;
      |                  ^
main.c:16:17: error: 'y' undeclared (first use in this function)
   16 |       sum += b*(y-x);
      |                 ^