Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

需要注意的几种输入(附解题报告)

Posted by jinyingqi at 2011-04-12 20:42:06 on Problem 1001
需要注意的是各种输入格式处理:123, 0123, 012.3, 123., 123.0, 123.01, .123, .1230等等,我的方法是先把如上这些情况输入处理成(123,0),(123,0),(123,1),(123,0),(123,0),(12301,2),(123,3),(123,3)这些形式。即删除小数点,删除多余前面的0与后面的0存储,并且返回小数位数。整数乘幂运算过后再增加小数点处理。输出的时候注意1、整数不打印小数点 2、删除多余尾0  3、0.xxxx形式小数输出.xxxx

其中,字符串加、乘都写好相应子程序,子程序为了方便使用最好允许操作数与结果指向同一地址,即mul(result,op2,result)形式。


解题报告:
http://blog.csdn.net/koala002/archive/2011/04/12/6318894.aspx
希望有所帮助

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator