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

PASCAL 1AC 4WA 一定要用长整型啊亲!!!

Posted by aiouniya at 2012-08-29 16:18:08 on Problem 3094
var s:string;
    i,l,sum:longint;
begin
  readln(s);
  while s<>'#' do begin
    l:=length(s);
    sum:=0;
    for i:=1 to l do
      if s[i]<>' ' then
      sum:=sum+(ord(s[i])-64)*i;
    writeln(sum);
    readln(s);
  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