Advertisement
DoGy70

Untitled

Mar 21st, 2023
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3. Online C Compiler.
  4. Code, Compile, Run and Debug C program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <stdio.h>
  10.  
  11. int main()
  12. {
  13. double kvMetri, kgGrapes, litresSell;
  14. int workers;
  15. printf("Vuvedete kv.metri, kilogrami grozde na 1 kv.metyr, litri za prodan i broi rabotnici: ");
  16. scanf("%lf %lf %lf %d", &kvMetri, &kgGrapes, &litresSell, &workers);
  17.  
  18. double kgGrapesTotal = (kvMetri * kgGrapes) * 0.4;
  19. double litresWine = kgGrapesTotal / 2.5;
  20.  
  21. double litresWineForWorker;
  22. double litresForWorkes;
  23. if (litresWine > litresSell) {
  24. litresWine -= litresSell;
  25. litresWineForWorker = litresWine / workers;
  26.  
  27. printf("Vinoto dostiga! Polaga se %lf litra na rabotnik!", litresWineForWorker);
  28. } else {
  29. litresSell -= litresWine;
  30.  
  31. printf("Vinoto ne dostiga! Trqbvat oshte %lf litra.", litresSell);
  32. }
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement