I'm trying to code a program that categorized a series to be one of the following for example:
- "demo" ; "abc" - are both hard ascending series.
- "aabc" ; "aa" ; "zz" - are an ascending series.
- "zzabcd" - is a non-ordered series.
I wrote the following:
#include <stdio.h>
int main()
{
int c1,c2;
int ascend=0;
int descend=0;
int fixed = 0;
c1=getchar();
c2=getchar();
putchar(c1);
while ((c1!= EOF) || (c2!=EOF))
}
putchar(c2(;
if (c1<c2(
ascend=1;
else if (c1>c2(
descend=1;
else if (c1==c2(
fixed =1;
c1=c2;
c2=getchar();
{
printf("\n%d\n%d\n%d" ,ascend,descend,fixed);
can someone help me arrange it and make it work ? It should work with linux, but nothing helps it just don't work.