javigom / AceptaElReto

Recopilación de problemas resueltos de la web aceptaelreto.com

Home Page:https://aceptaelreto.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Acepta el Reto

Recopilación de problemas resueltos de la web aceptaelreto.com

Realizado por Javier Gómez Moraleda.

MIT License.

PLANTILLAS PARA LOS EJERCICIOS

NÚMERO DE CASOS

#include <iostream>

using namespace std;

void casoDePrueba() {

}

int main() {

	unsigned int numCasos, i;
	cin >> numCasos;

	for (int i = 0; i < numCasos; i++) {
		casoDePrueba();
	}

	return 0;
}

MARCA FINAL

#include <iostream> 
using namespace std;

bool casoDePrueba() {
	
	//leercasodeprueba
	if(es el caso que marca el final)
		return false;
	
	else{
		//CÓDIGO PRINCIPAL AQUÍ 
		return true;
	}
} //caso De Prueba 

int main() { 
	
	while(casoDePrueba()){
	}
	return 0;
} 

FIN DE LA ENTRADA

#include <iostream>
using namespace std;

bool casoDePrueba() {

	//leer caso de prueba
	if(!cin)
		return false;

	else{
		//CÓDIGO PRINCIPAL AQUÍ
		return true;
	}
} //caso De Prueba 

int main() {

	while(casoDePrueba()) {

	}

	return 0;
}

E/S PARA FICHERO DE DATOS

#include <fstream>

int main() {
#ifndef DOMJUDGE
	std::ifstream in("datos.txt");
	auto cinbuf = std::cin.rdbuf(in.rdbuf());
#endif

	While(resuelveCaso()){
	}

#ifndef DOMJUDGE 
	std::cin.rdbuf(cinbuf);
#endif
	return 0;
}

About

Recopilación de problemas resueltos de la web aceptaelreto.com

https://aceptaelreto.com/

License:MIT License


Languages

Language:C++ 100.0%