摘要:
将程序日志中的树状结构的报文,转换为XML格式的报文。输入样式为 1 ├─0.COMMON_INFO(utype) 2 │ ├─0.PROVINCE_GROUP(string):10017 3 │ ├─1.SESSION_ID(string):Dj32QgQQlzjD2MFRn1JKcLlffXL6xfFRKn313Bnyr8SwfGV12dQS!903836304!1348468960414 4 │ ├─2.SER_NAME(string): 5 │ ├─3.ROUND_AUDIT(string):Y 6 │ ├─4.DEST_IP(string):172.21.0.123 7 │... 阅读全文
摘要:
Problem 2021 June 2002n! meansn(n1)...321For example, 10! = 109...321 = 3628800,and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.Find the sum of the digits in the number 100!Answer:648这个题,复用的第16题写的大数字类BigNum的运算。void p20(){ BigNum bn(1); BigNum ab=bn; BigNum tt; ... 阅读全文
摘要:
Problem 1603 May 2002215= 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number 21000?Answer:1366C++貌似没有现成的对超大数字的支持,我写了个用来计算超大数字的类。为了简单,没有动态分配数组长度。//设置长数字的最大容量const int MAX_LENGTH = 1000;//计算数字的位数int GetDigitCount(int n){ int c = 0 ; while (n) ... 阅读全文