UVa OJ 10994-Simple Addition
2011-01-30 23:09
211 查看
纯数学题,搞了好久:
{ Author:wzx961008 Problem:UVa 10994-Simple Addition Verdict:Accepted Language:PASCAL Run Time:0.028s Submission Date:2011-01-30 15:00:23 } var p,q:longint; function f(n:int64):int64; var ans:int64; i:longint; begin if n<=0 then exit(0); ans:=0; while n<>0 do begin inc(ans,(n div 10)*45); for i:=(n div 10)*10+1 to n do inc(ans,i mod 10); n:=n div 10; end; exit(ans); end; begin while true do begin readln(p,q); if (p=-1)and(q=-1) then break; writeln(f(q)-f(p-1)); end; end.
相关文章推荐
- UVA 10994 Simple Addition
- UVA 10994 Simple Addition
- uva 10994 - Simple Addition
- uva 10994 - Simple Addition(规律)
- uva 10994 - Simple Addition(规律)
- 10994 - Simple Addition(规律)
- UVA - 10994 Simple Addition
- 10994 - Simple Addition(规律)
- uva10994 - Simple Addition
- UVa 10994 - Simple Addition
- uva 10994 - Simple Addition
- UVA 10994 Simple Addition
- uva 10994 Simple Addition
- UVa 10994 - Simple Addition
- UVa OJ 142 - Mouse Clicks (鼠标点击)
- UVa OJ 10035-Primary Arithmetic
- UVa OJ 748-Exponentiation
- uva oj 489
- Uva OJ 644 - Immediate Decodability
- Uva oj (算法入门经典) 排序与检索系列水题系列