1
public
int
WordStatistical(
string
CString)
2 {
3 int digit = 0 ;
4 for ( int i = 0 ;i < CString.Length ; i ++ )
5 {
6 if (Convert.ToInt32(Convert.ToChar(CString.Substring(i, 1 ))) < Convert.ToInt32(Convert.ToChar( 128 )))
7 {
8 digit += 1 ;
9 }
10 else
11 {
12 digit += 2 ;
13 }
14 }
15 return digit;
16 }
2 {
3 int digit = 0 ;
4 for ( int i = 0 ;i < CString.Length ; i ++ )
5 {
6 if (Convert.ToInt32(Convert.ToChar(CString.Substring(i, 1 ))) < Convert.ToInt32(Convert.ToChar( 128 )))
7 {
8 digit += 1 ;
9 }
10 else
11 {
12 digit += 2 ;
13 }
14 }
15 return digit;
16 }