动物们不能因为地位比我们低就被随意杀害!
👍 1 赞
<p>#include <iostream></p><p>using namespace std;</p><p>void print_utf8(unsigned int codepoint)</p><p>{</p><p> if (codepoint <= 0x7F)</p><p> {</p><p> cout << static_cast<char>(codepoint);</p><p> }</p><p> else if (codepoint <= 0x7FF)</p><p> {</p><p> cout << static_cast<char>(0xC0 | ((codepoint >> 6) & 0x1F));</p><p> cout << static_cast<char>(0x80 | (codepoint & 0x3F));</p><p> }</p><p> else if (codepoint <= 0xFFFF)</p><p> {</p><p> cout << static_cast<char>(0xE0 | ((codepoint >> 12) & 0x0F));</p><p> cout << static_cast<char>(0x80 | ((codepoint >> 6) & 0x3F));</p><p> cout << static_cast<char>(0x80 | (codepoint & 0x3F));</p><p> }</p><p>}</p><p>int main()</p><p>{</p><p> long long total = 0;</p><p> const unsigned int start = 0x4E00;</p><p> const unsigned int end = 0x9FFF;</p><p> for (unsigned int ch = start; ch <= end; ch++)</p><p> {</p><p> total++;</p><p> print_utf8(ch);</p><p> }</p><p> cout << "\n\n全部Unicode标准汉字输出完毕,总数量:" << total << endl;</p><p> return 0;</p>}
👍 0 赞
<p>2年 对不对</p><p></p><p></p>
👍 0 赞
👍 0 赞