PLSQL Developer 12 (64 bit)计算s=1!+2!+...+10!
时间: 2023-11-27 21:03:39 浏览: 125
PLSQL Developer 12 (64 bit)
以下是PLSQL Developer 12 (64 bit)计算s=1!+2!+...+10!的代码:
```sql
DECLARE
s NUMBER := 0;
factorial NUMBER := 1;
BEGIN
FOR i IN 1..10 LOOP
factorial := factorial * i;
s := s + factorial;
END LOOP;
DBMS_OUTPUT.PUT_LINE('s = ' || s);
END;
```
运行结果为:
```
s = 4037913
```
阅读全文