forked from LM9001/C
-
Notifications
You must be signed in to change notification settings - Fork 0
/
posudice.c
52 lines (43 loc) · 1021 Bytes
/
posudice.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>
#include <math.h>
int main(){
int a;
int b;
int c;
int d;
int e;
int mlyko;
printf("Unesi kapacitet posudice a:\n");
scanf("%d", &a);
printf("Unesi kapacitet posudice b:\n");
scanf("%d", &b);
printf("Unesi kapacitet posudice c:\n");
scanf("%d", &c);
printf("Unesi kapacitet posudice d:\n");
scanf("%d", &d);
printf("Unesi kapacitet posudice e:\n");
scanf("%d", &e);
printf("Unesi kapacitet mlijeka:\n");
scanf("%d", &mlyko);
if(mlyko>=a){
a=a;
mlyko-=a;
}else {a=mlyko; mlyko=0;}
if(mlyko>=b){
b=b;
mlyko-=b;
}else {b=mlyko; mlyko=0;}
if(mlyko>=c){
c=c;
mlyko-=c;
}else {c=mlyko; mlyko=0;}
if(mlyko>=d){
d=d;
mlyko-=d;
}else {d=mlyko; mlyko=0;}
if(mlyko>=e){
e=e;
mlyko-=e;
}else {e=mlyko; mlyko=0;}
printf("%d %d %d %d %d", a,b,c,d,e);
}