119312024-11-20 20:49:22SRobVölgy (100 pont)cpp11Forditási hiba


#include "stdafx.h"
#include <iostream>

using namespace std;


int main()
{
	int N;
	cin >> N;

	int elol;
	int elolIndex= 0;
	elol = 0;
	int mostaniMax = 0;
	int maxHossz = 0;
	int most;
	int elozo;
	for (int i = 0; i < N; i++)
	{
		
		cin >> most;
		if (i == 0)
		{
			elozo = most;
			elol = most;
		}
		if (i > 0)
		{
			
			if (most < elol)
			{
				mostaniMax++;
			}
			else if(most < elol && elozo > most)
			{
				elol = elozo;
				elolIndex = i-1;
				mostaniMax = 0;
			}
			else if (most >= elol && most > elozo)
			{
				mostaniMax++;
			}
			
			else if(most >= elol && most == elozo)
			{
				elol = most;
				elolIndex = i;
				mostaniMax = 0;
			}
			if (mostaniMax > maxHossz)
				{
					maxHossz = mostaniMax;
				}
			elozo = most;
		}
	}
	cout << maxHossz <<endl;
	

}

Forditási hiba
open /var/local/lib/isolate/404/box/a.out: no such file or directory
main.cpp:3:10: fatal error: stdafx.h: No such file or directory
    3 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.