作业帮 > 英语 > 作业

noip2008复赛题目

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:英语作业 时间:2024/06/30 17:10:07
noip2008复赛题目
noip2008复赛题目
第一题
Program Gy;
Const
Name='isbn';
Var
A,B:String;
Procedure Inp;
Begin
Assign(Input,Name+'.in');Reset(Input);
Assign(Output,Name+'.out');Rewrite(Output);
Readln(A);
End;
Procedure Main;
Var i,j,k:Longint;
Begin
j:=0;k:=0;
For i:=1 to Length(A)-1 do
If A[i]in['0'..'9']then
Begin
Inc(k);
j:=j+(Ord(A[i])-Ord('0'))*k;
End;
j:=j mod 11;
B:=A;
If j=10 then B[Length(B)]:='X'Else B[Length(B)]:=Chr(j+Ord('0'));
End;
Procedure Oup;
Begin
If B=A then Writeln('Right')
Else Writeln(B);
Close(Input);
Close(Output);
End;
Begin
Inp;
Main;
Oup;
End.
第二题
Program Gy;
Uses Math;
Const
Name='seat';
Var
x1,y1,x2,y2:Array[1..3000]of Longint;
N,M,K,L,D:longint;
A,C:Array[1..2,1..2000]of Longint;
B1,B2:Array[1..2000]of Byte;
Procedure Inp;
Var i:longint;
Begin
Assign(Input,Name+'.in');Reset(Input);
Assign(Output,Name+'.out');Rewrite(Output);
Randomize;
Readln(M,N,K,L,D);
For i:=1 to D do Readln(x1[i],y1[i],x2[i],y2[i]);
End;
Procedure Sort(p,l,r:Longint);
Var i,j,x,y:Longint;
Begin
i:=l;j:=r;x:=a[p,Random(r-l)+l];
Repeat
While a[p,i]>x do Inc(i);
While a[p,j]