program MIDI; uses crt; var i,n :integer; A:array[1..100] of integer; KT: boolean; begin clrscr; write('Nhap so n: ');readln(n); For i:=1 to n do begin write('A[',i,']= '); readln(A[i]); end; For i:=2 to n-1 do if (A[i+1]>A[i]) and (A[i+2]<A[i+1]) then KT:=true; For i:=2 to n-1 do if (A[i+1]<=A[i])and (A[i+2]>=A[i+1]) then begin KT:=false; break; end; if KT=true then write('YES'); if KT=false then write('NO'); readln; end. Các bác chạy đoạn chương trình này rồi nhập 1,2,3,4,5,6 vào rồi nó lại sai các bác thấy em sai ở đâu chỉ em với Đây là bài về dãy số đơn điệu nghĩa là thế này:2>1<3>2

Các câu hỏi liên quan