Submit solution
Points:
1.00 (partial)
Time limit:
1.0s
Memory limit:
256M
Input:
stdin
Output:
stdout
Author:
Problem source:
Problem type
Allowed languages
C, C#, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Cho mảng số nguyên A[] gồm N phần tử và số nguyên X , hãy đếm xem trong mảng có bao nhiêu số lớn hơn X và bao nhiêu số nhỏ hơn X.
Đầu vào
Dòng đầu tiên là số nguyên dương N
Dòng thứ 2 gồm N số nguyên viết cách nhau một vài khoảng trắng
Dòng thứ 3 là số nguyên X
Giới hạn
1<=N<=1000
-10^3<=A[i]<=10^3
Đầu ra
Dòng 1 in ra các số nhỏ hớn X, dòng 2 in ra các số lớn hơn X
Ví dụ :
Input 01
5
-798 183 434 850 555
135
Output 01
1
4
Comments
<3
bài này sai ở đâu ko mn,sao đúng đc 23 test vậy,
include <bits/stdc++.h>
using namespace std; int main() { int d1=0,d2=0; int n,x; cin>>n; int a[n]; for(int i=0;i<n;i++) cin >> a[i]; cin>>x; for(int i=0;i<n;i++){ if (a[i]<x) d1++; else if(a[i>x]) d2++; } cout<<d1<
CODE
using namespace std;
int main() { int arr[10001]; int n; cin >> n;
}
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.