forked from taniadovzhenko/CppPracticum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmoney.c
More file actions
62 lines (41 loc) · 706 Bytes
/
money.c
File metadata and controls
62 lines (41 loc) · 706 Bytes
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
53
54
55
56
#include <stdio.h>
typedef
struct Money{
int grn; // grivnas
unsigned char kop; // kopiiky
}Money;
Money vvod(){
Money res;
int t;
printf("GRn=");
scanf(" %i",&res.grn);
//printf("%i",g);
//printf("kop=");
scanf(" %d",&t);
res.kop = (unsigned char) t;
return res;
}
int input(Money* x){
Money res;
int t;
printf("GRn=");
scanf(" %i",&res.grn);
//printf("%i",g);
//printf("kop=");
scanf(" %d",&t);
res.kop = (unsigned char) t;
*x =res;
return 0;
}
void vyvod(const Money x){
printf("%i gryven %u kop.",x.grn,x.kop);
}
int main(){
//struct Money x;
Money x;
int g;
unsigned char g1;
//x = vvod();
input(&x);
vyvod(x);
}