Advertisement
StoneHaos

261

Nov 2nd, 2019
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. //261
  2. #include <cstdio>
  3. #include <cmath>
  4.  
  5. int main(void) {
  6.     FILE* fin = fopen("input.txt", "r");
  7.     FILE* fout = fopen("output.txt", "w");
  8.  
  9.     double a, b, f1, f2, f3;
  10.     fscanf(fin, "%lf%lf", &a, &b);
  11.     fclose(fin);
  12.     f1 = (a + b) / 2;
  13.     f2 = sqrt(a * b);
  14.     f3 = sqrt(f1 * f2);
  15.  
  16.     fprintf(fout, "%.2f\n", f3);
  17.     fclose(fout);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement