Pagini recente » Cod sursa (job #736088) | Cod sursa (job #197544) | Cod sursa (job #2129949) | Cod sursa (job #159673) | Cod sursa (job #3205150)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("scmax.in");
ofstream fout("scmax.out");
int main() {
int n;
fin >> n;
int x, y;
int lungime = 1; // Start with length 1 for the first element
int lungimeMax = 1; // Initialize max length to 1
fin >> x;
while (fin >> y) {
if (x < y) {
lungime++; // Increase length if the sequence is increasing
} else {
lungime = 1; // Reset length if the sequence is not increasing
}
if (lungime > lungimeMax) {
lungimeMax = lungime; // Update max length if necessary
}
x = y; // Update previous element
}
fout << lungimeMax;
fin.close();
fout.close();
return 0;
}