Cod sursa(job #2672566)

Utilizator sorana5Gligor Sorana sorana5 Data 14 noiembrie 2020 11:02:45
Problema Subsir crescator maximal Scor 5
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.41 kb
#include <iostream>
#include <fstream>

using namespace std;

ifstream f("scmax.in");
ofstream g("scmax.out");

int n, v[100002], x, xant, nr;

int main()
{
    f>>n;
    for (int i = 1; i <= n; ++i)
    {
        f>>x;
        if (x > xant)
            nr++;
        else if (x < xant)
            nr = 1;
        xant = x;
    }
    g<<nr;

    f.close();
    g.close();
    return 0;
}