Advertisement
STANAANDREY

pc9

Oct 6th, 2022
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.   const double AVAILABLE_RONS = 20;
  5.   const double APPLES_KG_PRICE = 5;
  6.   const double PEARS_KG_PRICE = 7;
  7.  
  8.   double x, y;
  9.   printf("x="); scanf("%lf", &x);
  10.   printf("y="); scanf("%lf", &y);
  11.  
  12.   if (x * APPLES_KG_PRICE + y * PEARS_KG_PRICE <= AVAILABLE_RONS) {
  13.     puts("YES");
  14.   } else {
  15.     puts("NO");
  16.   }
  17.  
  18.   return 0;
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement