小编Sai*_*tap的帖子

素数代码 - 请帮我解决这个错误(如果'缺少'?)

SQL> ed
Wrote file afiedt.buf

  1  declare
  2  n number;
  3  i number;
  4  counter number;
  5  begin
  6  n:=&n;
  7  i:=1;
  8  counter:=0;
  9  if n=1
 10     then dbms_output.put_line('1 is a prime No.');
 11  else if n=2
 12     then dbms_output.put_line('2 is even prime');
 13  else
 14      for i in 1..n loop
 15     if mod(n,i)=0
 16              then counter:=counter+1;
 17             end if;
 18     end loop;
 19  end if;
 20  if counter=2
 21     then dbms_output.put_line(n||' is a prime No.');
 22  else
 23 …
Run Code Online (Sandbox Code Playgroud)

oracle plsql

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

oracle ×1

plsql ×1