Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我哪里做错了?大大帮我看一下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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator