ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

problem 1189 need help. thenks. here is a program
Posted by I am david. Tabo. 24 May 2002 10:52
var min,raod,max,i,j,n,l:longint;
    y:integer;
    k:byte;
    z,x,b,b1:string;
    a:array [1..100] of string;

procedure readdata;
  begin
    readln (n);
  end;

procedure number;
  begin
    str (n,x);
    k:=length (x);
    min:=1;
    for i:=1 to k-1 do
      min:=min*10;
    min:=n-min-1;
  end;

procedure solve;
  begin
    str (n,b1);
    for i:=min to n-1 do
      begin
        str (i,x);
        k:=length (x);
        z:=x;
        for j:=1 to k do
          begin
            delete (x,j,1);
            val (x,l,y);
            if i+l=n then
                begin
                inc (raod);
                str (i,b);
                a[raod]:=b+' + '+x+' = '+b1;
                break;
              end;
            x:=z;
          end;
      end;
  end;

procedure print;
  begin
    writeln (raod);
    for i:=1 to raod do
      writeln (a[i]);
  end;

begin
  readdata;
  number;
  solve;
  print;
end.
I want to say sth.
Posted by ECUST Multistar 24 May 2002 11:31
I didn't slove this problem yet.
But I think you get a right answer...
And then You 'll got a Time Limited Error....
Didn't you see the Time Limit?????
Help pliase. Thenks.
Posted by I am david. Tabo. 24 May 2002 13:39
var min,raod,max,i,j,n,l:longint;
    y:integer;
    k:byte;
    z,x,b,b1:string;
    a:array [1..100] of string;

procedure readdata;
  begin
    readln (n);
  end;

procedure number;
  begin
    str (n,x);
    k:=length (x);
    min:=1;
    for i:=1 to k-1 do
      min:=min*10;
    min:=n-min-1;
  end;

procedure solve;
  begin
    str (n,b1);
    for i:=min to n-1 do
      begin
        str (i,x);
        k:=length (x);
        z:=x;
        for j:=1 to k do
          begin
            delete (x,j,1);
            val (x,l,y);
            if i+l=n then
                begin
                inc (raod);
                str (i,b);
                a[raod]:=b+' + '+x+' = '+b1;
                break;
              end;
            x:=z;
          end;
      end;
  end;

procedure print;
  begin
    writeln (raod);
    for i:=1 to raod do
      writeln (a[i]);
  end;

begin
  readdata;
  number;
  solve;
  print;
end.