-
Notifications
You must be signed in to change notification settings - Fork 0
/
code of tamrin_3_4.c
84 lines (77 loc) · 2.55 KB
/
code of tamrin_3_4.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <stdio.h>
int main() {
int shape;
char m_m;
int a;
int b;
printf("code shekl ra vared konid: ");
scanf("%d",&shape);
printf("cod mohit ya masahat ra vared konid: ");
scanf(" %c",&m_m);
switch (shape) {
case 1:
switch (m_m) {
case 'm' :
printf("zel ra vared konid: ");
scanf(" %d",&a);
int mohit=a*4;
printf("mohit : %d",mohit);
break;
case 'n':
printf("zel ra vared konid: ");
scanf("%d",&a);
int masahat=a*a;
printf("masahat: %d",masahat);
break;
default:
printf("worng charecter!!!");
break;
}
break;
case 2:
switch (m_m) {
case 'n':{
printf("zel 1 ra vared konid: ");
scanf("%d",&a);
printf("zel 2 ra vared konid: ");
scanf("%d",&b);
int mohitM=(a+b)*2;
printf("mohit : %d",mohitM);
break;}
case 'm':
printf("zel 1 ra vared konid: ");
scanf("%d",&a);
printf("zel 2 ra vared konid: ");
scanf("%d",&b);
int masahatM=a*b;
printf("masahat: %d",masahatM);
break;
default:
printf("worng charecter!!!");
break;
}
break;
case 3:
switch (m_m) {
case 'n':
printf("shoaa ra vared konid: ");
scanf("%d",&a);
int mohitD=a*a*3.14;
printf("mohit dayere : %d",mohitD);
break;
case 'm':
printf("ghotr ra vared konid: ");
scanf("%d",&a);
int masahatD=a*3.14;
printf("masaht dayere mosvi : %d",masahatD);
break;
default:
printf("worng charecter!!!");
break;
}
break;
default:
printf("worng charecter!!!");
break;
}
}