[input sample] 1-34081-2-978-7-11
[output sample] China
[input sample] 1-34081-2-978-1-11
The output sample Region. English
CodePudding user response:
Reference:# include
Int main ()
{
Int I=4, k=0, c=0;
Char s [18];
The scanf (" % s ", s);
While (s [I]) {
[I] if (s=='-') break;
C=c * 10 + s [I] - '0'.
i++;
}
The switch (c) {
Case 0:
Case 1: printf (" English Region \ n ");
break;
Case 2: printf (" French Region \ n ");
break;
Case 4: printf (" Japan \ n ");
break;
Case 7: printf (" China \ n ");
break;
Case 89: printf (" South Chesapeake \ n ");
break;
Case: 957
Case 986: printf (" Taiwan \ n ");
break;
Case: 962
Case 988: printf (" Hong Kong \ n ");
break;
Default: printf (" Bhutan \ n ");
break;
}
return 0;
}
CodePudding user response:
Fixed line 5 upstairs, k=0 defines redundant, changed to:int I=4, c=0;