SHOW:
|
|
- or go back to the newest paste.
| 1 | - | //1-й |
| 1 | + | CREATE OR REPLACE |
| 2 | - | package Gauss; |
| 2 | + | FUNCTION max_cost |
| 3 | - | import java.io.*; |
| 3 | + | RETURN CHAR IS |
| 4 | - | import java.util.*; |
| 4 | + | CURSOR c_rent IS |
| 5 | SELECT * FROM Rent; | |
| 6 | - | import javax.imageio.stream.FileImageInputStream; |
| 6 | + | arg c_rent%rowtype; |
| 7 | max_arg c_rent%rowtype; | |
| 8 | - | public class Gauss {
|
| 8 | + | count_max NUMBER; |
| 9 | - | public StreamTokenizer inf; |
| 9 | + | several EXCEPTION; |
| 10 | - | public PrintWriter outf; |
| 10 | + | |
| 11 | - | public PrintWriter out; |
| 11 | + | BEGIN |
| 12 | - | float eps = (float)0.00001; |
| 12 | + | DBMS_OUTPUT.ENABLE; |
| 13 | - | public static void main(String[] args)throws Exception {
|
| 13 | + | OPEN c_rent; |
| 14 | - | new Gauss().run(); |
| 14 | + | FETCH c_rent INTO max_arg; |
| 15 | - | } |
| 15 | + | |
| 16 | - | } |
| 16 | + | count_max:=1; |
| 17 | LOOP | |
| 18 | EXIT WHEN c_rent%NOTFOUND; | |
| 19 | - | //2-й |
| 19 | + | FETCH c_rent INTO arg; |
| 20 | - | package GaussMainEl; |
| 20 | + | IF arg.Rn>max_arg.Rn THEN |
| 21 | - | import java.io.*; |
| 21 | + | max_arg:=arg; |
| 22 | - | import java.util.*; |
| 22 | + | count_max:=1; |
| 23 | - | import Gauss.Gauss; |
| 23 | + | ELSEIF arg.Rn=max_arg.Rn THEN |
| 24 | count_max:=count_max+1; | |
| 25 | - | public class GaussMainEl {
|
| 25 | + | END IF; |
| 26 | END LOOP; | |
| 27 | CLOSE c_rent; | |
| 28 | - | public static void main(String[] args)throws Exception {
|
| 28 | + | IF count_max>1 THEN |
| 29 | - | new GaussMainEl().run(); |
| 29 | + | RAISE several; |
| 30 | ELSE | |
| 31 | - | } |
| 31 | + | --DBMS_OUTPUT.PUT_LINE(max_arg.Type); |
| 32 | RETURN max_arg.Type; | |
| 33 | - | public void run() throws Exception{
|
| 33 | + | END IF; |
| 34 | - | new Gauss().run(); |
| 34 | + | EXCEPTION |
| 35 | - | } |
| 35 | + | WHEN several THEN |
| 36 | - | } |
| 36 | + | DBMS_OUTPUT.PUT_LINE('Несколько типов недвижимости');
|
| 37 | RETURN max_arg.Type; | |
| 38 | END; | |
| 39 | END max_cost; | |
| 40 | / |