讨论 / 快帮帮忙,我卡了
lzy 2009-05-31 17:40:00
点我顶贴 收藏 删除
那位高手指点一下?我是用PASCAL做的
#1 lzy@2009-05-30 05:36:00
回复 删除
123131
#2 小小小学生@2009-05-31 03:07:00
回复 删除
这题有点想做。。。。

但是有点懒`

#3 niu@2009-05-31 17:38:00
回复 删除
我的程序,恶心死你~

var a,b,c:string;

x1,x2,x3:array[0..2]of int64;

he:array[1..2]of int64;

i:longint;

begin

readln(a);readln(b);readln(c);

if a[1]=’-’ then begin delete(a,1,1);x1[0]:=-1;end else x1[0]:=1;

if b[1]=’-’ then begin delete(b,1,1);x2[0]:=-1;end else x2[0]:=1;

if c[1]=’-’ then begin delete(c,1,1);x3[0]:=-1;end else x3[0]:=1;

val(copy(a,length(a)-12+1,12),x1[2]);val(copy(a,1,length(a)-12),x1[1]);

val(copy(b,length(b)-12+1,12),x2[2]);val(copy(b,1,length(b)-12),x2[1]);

val(copy(c,length(c)-12+1,12),x3[2]);val(copy(c,1,length(c)-12),x3[1]);

for i:=1 to 4 do begin

he[1]:=x1[1]*x1[0];he[2]:=x1[2]*x1[0];

if i<=2 then begin he[1]:=he[1]+x2[1]*x2[0];he[2]:=he[2]+x2[2]*x2[0];end;

if i>2 then begin he[1]:=he[1]-x2[1]*x2[0];he[2]:=he[2]-x2[2]*x2[0];end;

if i mod 2=0 then begin he[1]:=he[1]+x3[1]*x3[0];he[2]:=he[1]+x3[2]*x3[0];end;

if i mod 2<>0 then begin he[1]:=he[1]-x3[1]*x3[0];he[2]:=he[2]-x3[2]*x3[0];end;

he[2]:=he[1]*1000000000000+he[2];he[1]:=0;

if (he[2]=4) then begin

if x1[0]=-1 then write(’-’,a) else write(a);

if(x2[0]=-1)and(i<=2)then write(’-’,b);

if(x2[0]=1)and(i<=2)then write(’+’,b);

if(x2[0]=-1)and(i>2)then write(’-’,b);

if(x2[0]=1)and(i>2)then write(’+’,b);

if(x3[0]=-1)and(i mod 2=0)then write(’-’,c);

if(x3[0]=1)and(i mod 2=0)then write(’+’,c);

if(x3[0]=1)and(i mod 2<>0)then write(’-’,c);

if(x3[0]=-1)and(i mod 2<>0)then write(’+’,c);

end;

end;

writeln(’no’);

end.

#4 niu@2009-05-31 17:40:00
回复 删除
啊啊啊对不起~

我刚才发的是错的程序~

不过也没错多少,加上一个‘halt’就行。

查看更多回复
提交回复