-
Notifications
You must be signed in to change notification settings - Fork 0
/
sequenciaordenada.c
55 lines (44 loc) · 1.04 KB
/
sequenciaordenada.c
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: sequenciaordenada.c
* Author: eveli
*
* Created on 17 de Setembro de 2017, 14:36
* */
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int main(int argc, char** argv) {
int n=1, aux=0;
float num, pri;
while(n!=0){
scanf("%d", &n);
if(n!=0){
scanf("%f", &pri);
while(n>1){
scanf("%f", &num);
if(pri<num&&aux!=2){
pri=num;
aux=1;
}
else{
aux=2;
}
n--;
}
if(aux==1){
printf("ORDENADA\n");
}
else{
printf("DESORDENADA\n");
}
}
}
return (EXIT_SUCCESS);
}