/ Vijos / 讨论 / 分享 /

usaco—— Friday

我交一个程序,出这个。。。往大牛能解决

I'm sorry, but your authorization ID did not appear. If you think this is an error, please send email to Rob Kolstad with a short explanatory note.

Just so you'll know, your filename was ''.

";

程序是

{

ID: yy_02273

PROG: friday

LANG: PASCAL

}

Program friday;

const m : array[1..12] of longint =

(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

var

n, i, x, j, u, k : longint;

falg : boolean;

f : array[0..6] of longint;

function run(year : longint) : boolean;

begin

run := false;

if ((year mod 4 = 0) and (year mod 100 0)) or (year mod 400 = 0) then

run := true;

end;

begin

assign(input, 'friday.in'); reset(input);

assign(output, 'friday.out'); rewrite(output);

readln(n);

for i := 1 to n do

begin

falg := run(1900+i-1);

for j := 1 to 12 do

begin

u := m[j];

if (falg) and (j = 2) then inc(u);

k := 0;

repeat

x := (x + 1) mod 7;

inc(k);

if k = 13 then inc(f[x]);

until k = u;

end;

end;

write(f[6],' ',f[0]);

for i := 1 to 5 do

writeln(' ',f[i]);

close(input); close(output);

end.

大牛帮帮忙。。。

3Q油

3 条评论

  • @ 2009-08-13 10:07:33

    我MS没错

    RT

  • @ 2009-08-13 09:43:39

    ~~

    问USACO的题目可以到OIBH或者美国的USACO论坛.而且有数据的话,找别人帮忙还是自己检查来得快.当然不是看着程序检查

  • @ 2009-08-13 09:42:56

    在线等

    RT

  • 1