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

我用int64怎么还错?

Posted by dfg at 2005-06-04 20:43:29 on Problem 1654
var     mt,mi           :longint;
        x,y             ,
        x1,y1,s         :int64;
        ch              :char;

begin
//assign(input,'p.c'); reset(input);
        readln(mt);
        for mi:=1 to mt do begin
                x:=0; y:=0; s:=0;
                repeat
                        x1:=x; y1:=y;
                        read(ch);
                        case ch of
                                '8':inc(y);
                                '2':dec(y);
                                '6':inc(x);
                                '4':dec(x);
                                '9':begin dec(y); inc(x) end;
                                '7':begin dec(y); dec(x) end;
                                '3':begin inc(y); inc(x) end;
                                '1':begin inc(y); dec(x) end;
                                '5':break;
                        end;
                        s:=s+x1*y-y1*x;
                until false;
                readln;
                while seekeoln do readln;
                if s<0 then s:=-s;
                if odd(s) then writeln(s shr 1,'.5')
                else writeln(s shr 1);
        end;
end.

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