Sha256: 7de28e5a4e20cd77b10da82abf9118486b55630fa76579d513a9dd6721904db7

Contents?: true

Size: 1.87 KB

Versions: 6

Compression:

Stored size: 1.87 KB

Contents

#include <iostream>
#include <fstream>
using namespace std;

int main(int argc, char const *argv[])
{
  ofstream ofs;
  ofs.open("Main.java",ios::binary);
  string buf;
  while(getline(cin,buf)){
    if(buf=="<$><*><$><*><$><*><$><*><$><*><$><*><$>")break;
    ofs<<buf<<endl;
  }
  ofs.close();
  ofs.open("test.in",ios::binary);
  while(getline(cin,buf)){
    ofs<<buf<<endl;
  }
  ofs.close();
  system("/opt/wandbox/openjdk-head/bin/javac Main.java");
  system("/usr/bin/time -f '%U' /opt/wandbox/openjdk-head/bin/java Main < test.in");
  return 0;
}




/*import java.util.*;
import java.io.*;
class Career{
  public static void main(String[] args){

    Scanner sc = null;
    File code =  null;
    PrintWriter pw = null;
    File stdin = null;
    PrintWriter pw2 = null;
    String str = null;
    BufferedReader br = null;
    Process compile = null;
    Runtime r = null;
    InputStream run = null;

    try{
      sc = new Scanner(System.in);
      code = new File("Main.java");
      stdin = new File("test.in");
      pw = new PrintWriter(new BufferedWriter(new FileWriter(code)));
      pw2 = new PrintWriter(new BufferedWriter(new FileWriter(stdin)));
      while(true){
       str = sc.next();
       if(str.equals("<$><*><$><*><$><*><$><*><$><*><$><*><$>")){
        break;
      }
      pw.println(str);
    }
    code.createNewFile();

    while(sc.hasNext()){
      str = sc.next();
      pw2.println(str);
    }
    stdin.createNewFile();

    r = Runtime.getRuntime();
    compile = r.exec("/opt/wandbox/openjdk-head/bin/javac Main.java");
    compile.waitFor();
    run = r.exec("/usr/bin/time -f '%U' /opt/wandbox/openjdk-head/bin/java Main < test.in").getInputStream();
    br = new BufferedReader(new InputStreamReader(run));
    String line;
    while ((line = br.readLine()) != null) {
      System.out.println(line);
    }
  }catch(Exception e ){
    e.printStackTrace();
  }
}
}*/

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
judge_system-1.3.0 lib/compile_systems/java_system.cpp
judge_system-1.2.4 lib/compile_systems/java_system.cpp
judge_system-1.2.3 lib/compile_systems/java_system.cpp
judge_system-1.2.2 lib/compile_systems/java_system.cpp
judge_system-1.2.1 lib/compile_systems/java_system.cpp
judge_system-1.2.0 lib/compile_systems/java_system.cpp