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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
| #include<stdio.h> #include <string.h>
int main(){ int R; int S; int RS; char R1[] = "unreadable"; char R2[] = "barely readable, occasional words distinguishable"; char R3[] = "readable with considerable difficulty"; char R4[] = "readable with practically no difficulty"; char R5[] = "perfectly readable"; char S1[] = "Faint signals, barely perceptible"; char S2[] = "Very weak signals"; char S3[] = "Weak signals"; char S4[] = "Fair signals"; char S5[] = "Fairly good signals"; char S6[] = "Good signals"; char S7[] = "Moderately strong signals"; char S8[] = "Strong signals"; char S9[] = "Extremely strong signals"; char sR[100]; char sS[100]; scanf("%d",&RS); R = RS / 10; S = RS % 10; switch (R) { case 1: strcpy(sR, R1); switch (S) { case 1: strcpy(sS, S1); break; case 2: strcpy(sS, S2); break; case 3: strcpy(sS, S3); break; case 4: strcpy(sS, S4); break; case 5: strcpy(sS, S5); break; case 6: strcpy(sS, S6); break; case 7: strcpy(sS, S7); break; case 8: strcpy(sS, S8); break; case 9: strcpy(sS, S9); break; } break; case 2: strcpy(sR, R2); switch (S) { case 1: strcpy(sS, S1); break; case 2: strcpy(sS, S2); break; case 3: strcpy(sS, S3); break; case 4: strcpy(sS, S4); break; case 5: strcpy(sS, S5); break; case 6: strcpy(sS, S6); break; case 7: strcpy(sS, S7); break; case 8: strcpy(sS, S8); break; case 9: strcpy(sS, S9); break; } break; case 3: strcpy(sR, R3); switch (S) { case 1: strcpy(sS, S1); break; case 2: strcpy(sS, S2); break; case 3: strcpy(sS, S3); break; case 4: strcpy(sS, S4); break; case 5: strcpy(sS, S5); break; case 6: strcpy(sS, S6); break; case 7: strcpy(sS, S7); break; case 8: strcpy(sS, S8); break; case 9: strcpy(sS, S9); break; } break; case 4: strcpy(sR, R4); switch (S) { case 1: strcpy(sS, S1); break; case 2: strcpy(sS, S2); break; case 3: strcpy(sS, S3); break; case 4: strcpy(sS, S4); break; case 5: strcpy(sS, S5); break; case 6: strcpy(sS, S6); break; case 7: strcpy(sS, S7); break; case 8: strcpy(sS, S8); break; case 9: strcpy(sS, S9); break; } break; case 5: strcpy(sR, R5); switch (S) { case 1: strcpy(sS, S1); break; case 2: strcpy(sS, S2); break; case 3: strcpy(sS, S3); break; case 4: strcpy(sS, S4); break; case 5: strcpy(sS, S5); break; case 6: strcpy(sS, S6); break; case 7: strcpy(sS, S7); break; case 8: strcpy(sS, S8); break; case 9: strcpy(sS, S9); break; } break; } printf("%s, %s.", sS, sR); return 0; }
|