-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4.5.cpp
55 lines (54 loc) · 975 Bytes
/
4.5.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
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
#include <iostream>
using namespace std;
int main()
{
int a,n,dudoan;
int b[n];
cout<<"Nhap vao so phan tu cua day so: "<<endl;
cin>>n;
for(int i = 0;i<n;i++)
{
cout<<"Nhap phan tu thu "<<i+1<<" cua day so: "<<endl;
cin>>a;
}
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n-1;j++)
{
if (b[i]<=b[j])
{
dudoan=0;
}
else if (b[i]>=b[j])
{
dudoan=1;
}
else if (b[i]<b[j])
{
dudoan=2;
}
else
{
dudoan=3;
}
}
}
cout<<dudoan<<endl;
if(dudoan==0)
{
cout<<"Day sap tang.";
}
else if(dudoan==1)
{
cout<<"Day sap giam.";
}
else if(dudoan==2)
{
cout<<"Day tang ngat.";
}
else
{
cout<<"Day giam ngat.";
}
return 0;
}