Rev | Line | |
---|

[486] | 1 | int if_jian(int a, int b, int c, int d, int e, int f,int g, int x, int y){ |
---|

| 2 | int u,v; |
---|

| 3 | int t1,t2,t3,t4,t5; |
---|

| 4 | |
---|

| 5 | t1 = (a+b)<c; |
---|

| 6 | t2 = d + e; |
---|

| 7 | t3 = c + 1; |
---|

| 8 | |
---|

| 9 | if(y==1){ |
---|

| 10 | if(t1) |
---|

| 11 | u = t3 +d; |
---|

| 12 | else if (!x) |
---|

| 13 | u = t2 + d; |
---|

| 14 | if(!t1 && x) |
---|

| 15 | v = t2 + e; |
---|

| 16 | } |
---|

| 17 | else{ |
---|

| 18 | t4 = t3 + e; |
---|

| 19 | t5 = t4 + f; |
---|

| 20 | u = t5 + g; |
---|

| 21 | } |
---|

| 22 | return u; |
---|

| 23 | } |
---|

| 24 | |
---|

| 25 | int if_exSimple (int a, int b) { |
---|

| 26 | int g; |
---|

| 27 | if (a<b) { |
---|

| 28 | int e; |
---|

| 29 | e = a+b; |
---|

| 30 | e = 2*e; |
---|

| 31 | g = e; |
---|

| 32 | } |
---|

| 33 | else { |
---|

| 34 | int f; |
---|

| 35 | f = 2*b; |
---|

| 36 | f = f+a; |
---|

| 37 | g = f+b; |
---|

| 38 | } |
---|

| 39 | return g; |
---|

| 40 | } |
---|

| 41 | |
---|

| 42 | int if_imbriq1 (int a, int b, int c) { |
---|

| 43 | int result; |
---|

| 44 | if (a < b) { |
---|

| 45 | if (b < c) { |
---|

| 46 | result = b; |
---|

| 47 | } |
---|

| 48 | else { |
---|

| 49 | result = c; |
---|

| 50 | } |
---|

| 51 | } |
---|

| 52 | else { |
---|

| 53 | result = a; |
---|

| 54 | } |
---|

| 55 | return result; |
---|

| 56 | } |
---|

| 57 | |
---|

| 58 | int if_imbriq2 (int a, int b, int c) { |
---|

| 59 | int result; |
---|

| 60 | if (a < b) { |
---|

| 61 | if (b < c) { |
---|

| 62 | result = b; |
---|

| 63 | } |
---|

| 64 | else { |
---|

| 65 | result = 47; |
---|

| 66 | } |
---|

| 67 | } |
---|

| 68 | else { |
---|

| 69 | result = a; |
---|

| 70 | } |
---|

| 71 | return result; |
---|

| 72 | } |
---|

| 73 | |
---|

| 74 | int if_min (int a, int b) { |
---|

| 75 | int min; |
---|

| 76 | if (a > b) { |
---|

| 77 | min=b; |
---|

| 78 | } |
---|

| 79 | else { |
---|

| 80 | min=a; |
---|

| 81 | } |
---|

| 82 | return min; |
---|

| 83 | } |
---|

| 84 | |
---|

| 85 | int if_prog(int j,int i){ |
---|

| 86 | int a,b; |
---|

| 87 | a=i+j; |
---|

| 88 | if(a<0){ |
---|

| 89 | b=2; |
---|

| 90 | } |
---|

| 91 | else { |
---|

| 92 | b=3; |
---|

| 93 | } |
---|

| 94 | return b; |
---|

| 95 | } |
---|

| 96 | |
---|

| 97 | int if_sansElse (int a, int b) { |
---|

| 98 | int c = 0; |
---|

| 99 | if (a < b) { |
---|

| 100 | c = a; |
---|

| 101 | } |
---|

| 102 | return c; |
---|

| 103 | } |
---|

| 104 | |
---|

| 105 | int if_test(int a, int b, int x, int y) { |
---|

| 106 | int c =0, d=0, v=0, w=0, z = 0; |
---|

| 107 | if (a<b) { |
---|

| 108 | c = a+b; |
---|

| 109 | } |
---|

| 110 | if (x<y) { |
---|

| 111 | z = x+y; |
---|

| 112 | w = z+x; |
---|

| 113 | } |
---|

| 114 | d = c+1; |
---|

| 115 | v = c+w; |
---|

| 116 | return c; |
---|

| 117 | } |
---|

| 118 | |
---|

| 119 | int if_ual (int op, int a, int b) { |
---|

| 120 | int result; |
---|

| 121 | if (op == 0) { |
---|

| 122 | result = a+b; |
---|

| 123 | } |
---|

| 124 | else { |
---|

| 125 | if (op == 1) { |
---|

| 126 | result = a-b; |
---|

| 127 | } |
---|

| 128 | else { |
---|

| 129 | if (op == 2) { |
---|

| 130 | result = a&&b; |
---|

| 131 | } |
---|

| 132 | else { |
---|

| 133 | if (op == 3) { |
---|

| 134 | result = a||b; |
---|

| 135 | } |
---|

| 136 | } |
---|

| 137 | } |
---|

| 138 | } |
---|

| 139 | return result; |
---|

| 140 | } |
---|

| 141 | |
---|

| 142 | int main(){ |
---|

| 143 | int a; |
---|

| 144 | a=if_jian(1,2,3,4,5,6,7,8,9); |
---|

| 145 | a=if_exSimple(1,2); |
---|

| 146 | a=if_imbriq1(1,2,3); |
---|

| 147 | a=if_imbriq2(1,2,3); |
---|

| 148 | a=if_min(1,2); |
---|

| 149 | a=if_prog(1,2); |
---|

| 150 | a=if_sansElse(1,2); |
---|

| 151 | a=if_test(1,2,3,4); |
---|

| 152 | a=if_ual(1,2,3); |
---|

| 153 | return a; |
---|

| 154 | } |
---|

**Note:** See

TracBrowser
for help on using the repository browser.