Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C Compiler.
- Code, Compile, Run and Debug C program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <stdio.h>
- int main()
- {
- double kvMetri, kgGrapes, litresSell;
- int workers;
- printf("Vuvedete kv.metri, kilogrami grozde na 1 kv.metyr, litri za prodan i broi rabotnici: ");
- scanf("%lf %lf %lf %d", &kvMetri, &kgGrapes, &litresSell, &workers);
- double kgGrapesTotal = (kvMetri * kgGrapes) * 0.4;
- double litresWine = kgGrapesTotal / 2.5;
- double litresWineForWorker;
- double litresForWorkes;
- if (litresWine > litresSell) {
- litresWine -= litresSell;
- litresWineForWorker = litresWine / workers;
- printf("Vinoto dostiga! Polaga se %lf litra na rabotnik!", litresWineForWorker);
- } else {
- litresSell -= litresWine;
- printf("Vinoto ne dostiga! Trqbvat oshte %lf litra.", litresSell);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement