fork download
  1. const fi='';
  2. nmax=100;
  3. type data=longint;
  4. var
  5. f:text;
  6. A:array[1..nmax] of data;
  7. n,t,m,s:data;
  8.  
  9. function min(a,b:data):data;
  10. begin
  11. if a<b then exit(a);
  12. exit(b);
  13. end;
  14.  
  15. procedure xuli;
  16. var i,j,k,z,x:data;
  17. begin
  18. assign(f,fi); reset(f);
  19. readln(f,t);
  20. for z:=1 to t do
  21. begin
  22. readln(f,n,m);
  23. for x:=1 to n do
  24. read(f,a[x]);
  25. s:=300100;
  26. for i:=1 to n-2 do
  27. for j:=i+1 to n-1 do
  28. for k:=j+1 to n do
  29. if a[i]+a[j]+a[k]<=m then
  30. s:=min(s,m-(a[i]+a[j]+a[k]));
  31. writeln(m-s);
  32. end;
  33. close(f);
  34. end;
  35.  
  36. begin
  37. xuli;
  38. end.
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:12: error: empty character constant
 const   fi='';
            ^~
prog.cpp:6:17: error: too many decimal points in number
         A:array[1..nmax] of data;
                 ^~~~~~~
prog.cpp:1:9: error: ‘fi’ does not name a type
 const   fi='';
         ^~
prog.cpp:2:9: error: ‘nmax’ does not name a type
         nmax=100;
         ^~~~
prog.cpp:3:1: error: ‘type’ does not name a type
 type    data=longint;
 ^~~~
prog.cpp:4:1: error: ‘var’ does not name a type
 var
 ^~~
prog.cpp:6:10: error: found ‘:’ in nested-name-specifier, expected ‘::’
         A:array[1..nmax] of data;
          ^
prog.cpp:6:9: error: ‘A’ does not name a type
         A:array[1..nmax] of data;
         ^
prog.cpp:7:9: error: ‘n’ does not name a type
         n,t,m,s:data;
         ^
prog.cpp:9:1: error: ‘function’ does not name a type
 function min(a,b:data):data;
 ^~~~~~~~
prog.cpp:10:1: error: ‘begin’ does not name a type
 begin
 ^~~~~
prog.cpp:12:13: error: expected constructor, destructor, or type conversion before ‘(’ token
         exit(b);
             ^
prog.cpp:13:1: error: ‘end’ does not name a type
 end;
 ^~~
prog.cpp:15:1: error: ‘procedure’ does not name a type
 procedure xuli;
 ^~~~~~~~~
prog.cpp:16:1: error: ‘var’ does not name a type
 var     i,j,k,z,x:data;
 ^~~
prog.cpp:17:1: error: ‘begin’ does not name a type
 begin
 ^~~~~
prog.cpp:18:28: error: expected constructor, destructor, or type conversion before ‘(’ token
         assign(f,fi); reset(f);
                            ^
prog.cpp:19:15: error: expected constructor, destructor, or type conversion before ‘(’ token
         readln(f,t);
               ^
prog.cpp:20:9: error: expected unqualified-id before ‘for’
         for z:=1 to t do
         ^~~
prog.cpp:23:25: error: expected unqualified-id before ‘for’
                         for x:=1 to n do
                         ^~~
prog.cpp:25:25: error: ‘s’ does not name a type
                         s:=300100;
                         ^
prog.cpp:26:25: error: expected unqualified-id before ‘for’
                         for i:=1 to n-2 do
                         ^~~
prog.cpp:31:32: error: expected constructor, destructor, or type conversion before ‘(’ token
                         writeln(m-s);
                                ^
prog.cpp:32:17: error: ‘end’ does not name a type
                 end;
                 ^~~
prog.cpp:33:14: error: expected constructor, destructor, or type conversion before ‘(’ token
         close(f);
              ^
prog.cpp:34:1: error: ‘end’ does not name a type
 end;
 ^~~
prog.cpp:36:1: error: ‘begin’ does not name a type
 begin
 ^~~~~
prog.cpp:38:1: error: ‘end’ does not name a type
 end.
 ^~~
stdout
Standard output is empty