Chinese character statistics

Source: Internet
Author: User

Chinese character statistics
Chinese character statisticsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission (s): 25457 Accepted Submission (s): 13857

The Problem Description counts the number of Chinese characters in a given text file.
The Input file contains an integer n, indicating the number of test instances, followed by n text segments.
Output outputs the number of Chinese characters for each piece of text, and the Output of each test instance occupies one line.

[Hint:] Considering the characteristics of inner codes of Chinese Characters ~

Sample Input

2 WaHaHa! WaHaHa! This year, WaHaHa only speaks Mandarin! WaHaHa! The final exam is coming soon. Are you ready?

Sample Output
149 question: as prompted, we obviously know that a Chinese character occupies two bytes, but we do not know much about the Chinese character in ASCLL, this question may not be easy to do, but it is actually very easy to do. There are 128 letters in ASCLL and their corresponding numbers correspond to each other. In this case, there must be no corresponding Chinese characters, it must be negative, so no need to explain the source code: # include
# Include
# Include
Int main () {int n, I, count, len; char str [200]; scanf ("% d", & n); getchar (); while (n --) {count = 0; gets (str); len = strlen (str); for (I = 0; I

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.