Skip to content

Instantly share code, notes, and snippets.

@Gabrielgtt
Created September 4, 2017 00:38
Show Gist options
  • Save Gabrielgtt/58e78ebd355f19b4fbcd76ae6fcde8f8 to your computer and use it in GitHub Desktop.
Save Gabrielgtt/58e78ebd355f19b4fbcd76ae6fcde8f8 to your computer and use it in GitHub Desktop.
from itertools import izip
from os import system
from time import time
system("g++ 1253_Cifra_de_cesar.cpp -o 1253")
antes = time()
system("./1253 <input >output")
depois = time()
print "Execution time = {0:.5f}".format(depois - antes)
saida = open("output", "r")
correto = open("c_output", "r")
compare = 0
if compare:
for i, linhas in enumerate(izip(saida.readlines(), correto.readlines())):
if linhas[0] != linhas[1]:
print "Erro encontrado na linha {0}".format(i+1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment