嘉祥初2016级18班吧 关注:11贴子:465

【one for all】free pascal程序展示

只看楼主收藏回复

1L壮哉我度娘~


1楼2013-12-03 13:33回复
    var
    a,n,s,i,b:integer;
    begin
    read(a,n);
    b:=a;
    s:=0;
    for i:=1 to n do
    begin
    s:=s+b;
    b:=10*b+a;
    end;
    write(s);
    end.
    题目:
    求和
    a+aa+aaa+aa..aa=?
    [n个a]


    3楼2014-01-19 21:14
    回复
      var
      a:char;
      b,c:integer;
      begin
      read(a);
      if a:='s' then b:=1;
      if a:='r' then b:=0;
      if a:='p' then b:=2;
      randomize;
      c:=random(3);
      if c=b then write('pingju')
      else if (c-b=1) or (c-b=-2) then write('you lose')
      else write('you win');
      end.
      【石头剪刀布】


      4楼2014-01-20 21:13
      收起回复


        来自iPhone客户端5楼2014-01-21 09:43
        收起回复
          var
          i:char;
          num1,num2:real;
          begin
          read(num1);
          read(i,i);
          read(num2);
          if i='+' then num2:=num1+num2
          else if i='-' then num2:=num1-num2
          else if i='*' then num2:=num1*num2
          else if i='/' then num2:=num1/num2;
          while i<>'=' do
          begin
          read(i,i);
          if i='=' then break;
          read(num1);
          if i='+' then num2:=num1+num2
          else if i='-' then num2:=num1-num2
          else if i='*' then num2:=num1*num2
          else if i='/' then num2:=num1/num2;
          end;
          write(num2:8:1);
          end.
          复杂的计算器问题,包括了多个运算符和多个运算量,为了简单起见,规定它按照输入的先后次序计算,而不考虑运算符的优先规则。如计算20+5*6+4+3/5=?,运算顺序为+*++/,考虑终止循环的条件是什么?与手工操作计算器


          6楼2014-01-26 21:08
          收起回复
            哦,天。看着就头晕……!@#¥%……&*()-——=+|、*


            7楼2014-01-27 21:09
            回复
              这为什么错了


              来自iPhone客户端9楼2014-02-09 13:56
              回复


                来自iPhone客户端10楼2014-02-09 15:06
                收起回复
                  19班的一名奇葩默默飘过……顺便问下德贝露莲莎谁呀?


                  IP属地:美国来自Android客户端11楼2014-02-09 23:41
                  收起回复
                    var
                    a:array['a'..'z'] of integer;
                    i:char;
                    begin
                    for i:='a' to 'z' do
                    a[i]:=0;
                    read(i);
                    while i<>'.' do
                    begin
                    if (i>='a') and (i<='z') then
                    a[i]:=a[i]+1;
                    read(i);
                    end;
                    for i:='a' to 'z' do
                    if a[i]<>0 then write(i,' ',a[i]);
                    end.
                    5、输入一段以句号结尾的英文,统计并输出句中各字母出现的次数。假设句中没有大写字母。


                    12楼2014-03-05 13:51
                    回复
                      Program point;
                      Const
                      x=5;
                      y=2;
                      Var
                      n:array[1..x] of string;
                      p,z:array[1..x] of longint;
                      i,m,k,t:longint;
                      td:text;
                      v,w:string;
                      a:char;
                      Begin
                      writeln('欢迎使用本计数软件!');
                      write('请输入评选的内容(将会作为文件名):');
                      readln(w);
                      w:=w+'.txt';
                      for i:= 1 to x do
                      begin
                      write('请输入',i,'号同学的姓名:');
                      readln(n[i]);
                      end;
                      for k:=1 to 49 do
                      for m:=1 to y do
                      begin
                      write('请输入第',k,'个同学的第',m,'个意见(请输入被选同学参与投票的号数):');
                      readln(p[m]);
                      t:=p[m];
                      z[t]:=z[t]+1;
                      end;
                      for m:=1 to x do
                      for i:=1 to x-m do
                      begin
                      k:=z[i]; z[i]:=z[i+1]; z[i+1]:=k;
                      v:=n[i]; n[i]:=n[i+1]; n[i+1]:=v;
                      end;
                      writeln;
                      assign(td,'C:\Documents and Settings\Administrator\桌面\'+w);
                      rewrite(td);
                      for i:=1 to y do writeln(n[i],'得了',z[i],'票,是第',i,'名。');
                      close(td);
                      writeln('这个文件已经保存至“C:\Documents and Settings\Administrator\桌面\',w,'”');
                      write('请按任意键继续……');
                      read(a);
                      end.


                      13楼2014-03-06 15:39
                      回复

                        @朱智语 使用挽尊卡

                        挽回他的尊严!

                        效果:嘉祥初20...吧经验+1



                        14楼2014-03-19 13:20
                        回复
                          var
                          a:array[1..10,1..10] of integer;
                          i,j:integer;
                          begin
                          a[1,1]:=1;
                          for i:=2 to 10 do
                          begin
                          a[i,1]:=1;
                          a[i,i]:=1;
                          for j:=2 to i-1 do
                          a[i,j]:=a[i-1,j-1]+a[i-1,j];
                          end;
                          for i:=1 to 10 do
                          begin
                          if i<>10 then write(' ':30-3*i);
                          for j:=1 to i do write(a[i,j]:6);
                          writeln;
                          end;
                          end.


                          15楼2014-03-19 13:40
                          收起回复
                            Begin
                            While 1<2 do write('your computer has been broken');
                            End.


                            来自iPhone客户端16楼2014-05-02 08:43
                            回复
                              const
                              a=5
                              x=record;
                              name1:array[1..a] of string;
                              number:array[1..a] of string;
                              cj1,cj2,cj3,cj4:array[1..a] of real;
                              end;
                              var
                              n,e:integer;
                              b:integer;
                              s:array[1..a] of real;
                              pj:array[1..a] of real;
                              i,j:integer;
                              zz:array[1..7,1..5] of real;
                              f:integer;
                              begin
                              for b:=1 to 5 do
                              readln((x.name1[b]),(x.number[b]),(x.cj1[b]),(x.cj2[b]),(x.cj3[b]),(x.cj4[b]));
                              s[a]:=(x.cj1[b])+(x.cj2[b])+(x.cj3[b])+(x.cj4[b]);
                              pj:=s[a]/4;
                              for n:=1 to a do
                              for e:1 to a-1 do
                              with x do
                              if s[e] <s[e+1] then
                              begin
                              f:=s[e];
                              s[e]:=s[e+1];
                              s[e+1]:=f;
                              end;
                              for i:=1 to 7 do
                              begin
                              for j:=1 to 5 do
                              begin
                              with x do
                              zz[1,j]:=name;
                              zz[2,j]:=(cj1[b]);
                              zz[3,j]:=(cj2[b]);
                              zz[4,j]:=(cj3[b]);
                              zz[5,j]:=(cj4[b]);
                              zz[6,j]:=(zf[b]);
                              zz[7,j]:=(pj(b));
                              end;
                              write(zz[i,j]);
                              end;
                              end.
                              1、利用记录,输入四个姓名,性别,语文、数学、英语、物理的成绩,计算每个人的总分,平均分。最后按照总分从高到低的顺序打印输出所有人的信息。
                              [有两个错待改--]
                              @朱智语


                              18楼2014-05-12 13:47
                              回复