Code
Static Void Main ( String [] ARGs)
{
Console. writeline (getchinesespell ( " Funny man in the world " ));
}
Static Public String Getchinesespell ( String Strtext)
{
Int Len = Strtext. length;
String Mystr = "" ;
For ( Int I = 0 ; I < Len; I ++ )
{
Mystr + = Getspell (strtext. substring (I, 1 ));
}
Return Mystr;
}
Static Public String Getspell ( String Cnchar)
{
Byte [] Arrcn = Encoding. Default. getbytes (cnchar );
If (Arrcn. Length > 1 )
{
Int Area = ( Short ) Arrcn [ 0 ];
Int Pos = ( Short ) Arrcn [ 1 ];
Int Code = (Area < 8 ) + Pos;
Int [] Areacode = { 45217 , 45253 , 45761 , 46318 , 46826 , 47010 , 47297 , 47614 , 48119 , 48119 , 49062 , 49324 , 49896 , 50371 , 50614 , 50622 , 50906 , 51387 , 51446 , 52218 , 52698 , 52698 , 52698 , 52980 , 53689 , 54481 };
For ( Int I = 0 ; I < 26 ; I ++ )
{
Int Max = 55290 ;
If (I ! = 25 ) Max = Areacode [I + 1 ];
If (Areacode [I] <= Code && Code < Max)
{
Return Encoding. Default. getstring ( New Byte [] {( Byte )( 65 + I )});
}
}
Return " * " ;
}
Else Return Cnchar;
}
}
Result:
Xtxkxzr