我是新手,想用Delphi编程进行计算,不知道怎样编写,比如(30x+11)(30y+19) ,x=0 to 50 ,y=0 to 50 ,if Mod[(30x+11)(30y+19),210]=89 and Mod[(30x+11)(30y+19),2310]=1139 and Mod[(30x+11)(30y+19),210]=1139 ,输出 x和y,望高手帮忙编一个,示范一下,谢谢.

解决方案 »

  1.   

    var i, x, y: Intgerfor x:= 0 to 50 do begin
      for y:= 0 to 50 do begin
        i:= (30 * x + 11) * (30 * y + 19);
        if     (i mod 210 = 89)
           and (i mod 2310 = 1139)
           and (i mod 210 = 1139) then begin // 1139 > 210 ???????????
          // OUTPUT.........
       end;
      end;
    end;
      

  2.   

    “百钱买百鸡”问题,楼主学C或pascal的时候没学么?
      

  3.   

    我可能没有说清楚,打开DELPHI 7.0 后,如何才能将程序写进去,写在什么地方,软件提供的这些要不要?
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;type
      TForm1 = class(TForm)
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}end.
      

  4.   

    這樣呀
    樓主可以在窗體上放兩個TEdit控件,一個用於顯示X,另一個用於顯示Y
    然後再在窗體上加上一個TButton,然後雙擊之
    在那個裡面寫上你的算法代碼,即可
      

  5.   

    New-->Other-->Console Applicationprogram Project1;{$APPTYPE CONSOLE}uses
      SysUtils;
    var
      i, x, y: Intger
    begin
      for x:= 0 to 50 do begin
      for y:= 0 to 50 do begin
        i:= (30 * x + 11) * (30 * y + 19);
        if     (i mod 210 = 89)
           and (i mod 2310 = 1139)
           and (i mod 210 = 1139) then begin // 1139 > 210 ???????????
          // OUTPUT.........
       end;
      end;
    end;end.
      

  6.   

    在窗体上可以加几个控件,edit和button,在button事件通过上面的算法就可以了。
      

  7.   

    blueice718(冰蓝)先生:    运行程序后,在什么地方才能看到结果?
      

  8.   

    樓主可以在窗體上放兩個TEdit控件,一個用於顯示X,另一個用於顯示Y