#include <stdio.h>

float pot (float, int);

int main() {
  float x, y, soma;
  int a, b;
    
  printf("Digite dois numeros reais: ");
  scanf("%f%f", &x, &y);
  printf("Digite dois numeros naturais: ");
  scanf("%d%d", &a, &b);

  soma = pot(x,a) + pot(y,b) + pot(x-y,a+b);
  printf("expressão = %f\n", soma);
  return 0;
}

/* função para calcular potência: base elevado a exp */
float pot (float base, int exp) {
  int i; float res = 1; 

  for (i = 0; i < exp; i++) 
    res *= base;
  return res;
}

