27802023-01-24 18:56:12CsongiÁruszállítás üres szakaszaicpp11Forditási hiba
//.h file code:

#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <iostream>

namespace aruszallitas_nemes01
{
	class Program
	{
	public:
		static void Main(std::vector<std::wstring> &args);
	};
}
// Farkas Gergely 9c 01/21/22

//Main function added by C# to C++ Converter:

#include <string>
#include <vector>

int main(int argc, char **argv)
{
	std::vector<std::wstring> args(argv + 1, argv + argc);
	aruszallitas_nemes01::Program::Main(args);
}

//.cpp file code:

#include "snippet.h"

namespace aruszallitas_nemes01
{

	void Program::Main(std::vector<std::wstring> &args)
	{
		std::set<int> idopontok; // idopontokat tartalmazo halmaz
		int counter = 0; // szamlalo
		std::vector<std::wstring> elsosor;
		std::getline(std::wcin, elsosor)->Split(L' '); // az elso sornak a bekerese

		for (int i = 0; i < std::stoi(elsosor[1]); i++) // vegigmegy az bemeneti idointervallumokon
		{

			std::vector<std::wstring> ints2;
			std::getline(std::wcin, ints2)->Split(L' '); // adott idointervallum szetszedese

			for (int j = std::stoi(ints2[0]); j <= std::stoi(ints2[1]); j++)
			{
				idopontok.insert(j); // az idointervallumokat belerakja a halmazba (minden idopontot)
			}
		}

		for (int i = 1; i <= std::stoi(elsosor[0]); i++) // vegignezi az idopontok halmazt, hogy benne van-e az adott idopont
		{

			if (!std::find(idopontok.begin(), idopontok.end(), i) != idopontok.end() && idopontok.Contains(i + 1))
			{
				counter++;
			}
		}

		if (std::find(idopontok.begin(), idopontok.end(), std::stoi(elsosor[0]) != idopontok.end()))
		{
			counter--; // biztonsagi feltetel, hogy az legutolso szakaszhoz meg ne szamoljon +1-et
		}

		std::wcout << counter << 1 << std::endl;

		Console::ReadKey();
	}
}
Forditási hiba
exit status 1
main.cpp:32:10: fatal error: snippet.h: No such file or directory
   32 | #include "snippet.h"
      |          ^~~~~~~~~~~
compilation terminated.
Exited with error status 1