CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Given a series of numbers, find the longest sequence in the series. A sequence could be one of the following:
AN ASCENDING SEQUENCE
Example:
input:836926
output:369
A DESCENDING SEQUENCE
Example:
input:2995316
output:9531
A EQUAL SEQUENCE
Example:
input:255566
output:555*/
// Enter number(1,2or3) space number(in which you want to find the sequence) 0(to end the program)
// This is the first program that took me over a week to finish. I HOPE YOU LIKE IT.
// P.S : IF YOU FIND ANY BUG PLESAE LET ME KNOW IN THE COMMENTS !!
#include <iostream>
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run