Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- int main()
- {
- char *sor = malloc (31 * sizeof(char));
- char *akt = malloc (31 * sizeof(char));
- int szam;
- int nov = 0;
- int csokk = 1;
- int db = 0;
- scanf("%d", &szam);
- while (db != szam+1)
- {
- gets(sor);
- if ( db == 0 )
- {
- strcpy(akt,sor);
- }
- else
- {
- if (strcmp(akt,sor) > 0 )
- {
- csokk = csokk + 1;
- strcpy(akt,sor);
- }
- if (strcmp(akt,sor) < 0 )
- {
- nov = nov + 1;
- strcpy(akt,sor);
- }
- }
- db++;
- }
- if (nov == db-1) printf("Ordered\n");
- else if (csokk == db-1) printf("Ordered\n");
- else printf("Unordered\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement