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 jimmyzzxhlh at 2005-09-07 14:14:31 on Problem 2498
const
  maxn = 100000;
var
  c : array[1..maxn] of char;
  n,tt,k,i,t,j,data : longint;

begin
  readln(data);
  for tt := 1 to data do begin
    n := 0;
    while not eoln(input) do begin
      inc(n); read(c[n]);
    end;
    readln;
    k := 9; t := 0;
    for i := n downto 1 do begin
      if c[i] = '?'
      then j := k
      else t := (t + k * (ord(c[i]) - 48)) mod 10;
      if k = 9 then k := 3 else if k = 3 then k := 7 else k := 9;
    end;
    writeln('Scenario #',tt,':');
    t := 10 - t;
    for i := 0 to 9 do
    if (i * j) mod 10 = t then break;
    for j := 1 to n do
    if c[j] <> '?' then write(c[j]) else write(i);
    writeln;
    writeln;
  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