Class: Cpp

Inherits:
Languages show all
Defined in:
lib/atcoder_greedy/lib/languages.rb

Constant Summary

Constants inherited from Languages

Languages::ALL_LANGUAGES

Instance Method Summary collapse

Methods inherited from Languages

#initialize

Constructor Details

This class inherits a constructor from Languages

Instance Method Details

#compile(problem_name) ⇒ Object



27
28
29
30
# File 'lib/atcoder_greedy/lib/languages.rb', line 27

def compile(problem_name)
  @exec_file = "#{problem_name}.out"
  system "g++ #{@solve_file} -o #{problem_name}.out"
end

#execute(input_path, output_path) ⇒ Object



32
33
34
# File 'lib/atcoder_greedy/lib/languages.rb', line 32

def execute(input_path, output_path)
  system "./#{@exec_file} < #{input_path} > #{output_path}"
end