Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int main() {
- int t, n, y, x, z;
- vector<int> num;
- cin >> t;
- for(int i = 1; i <= t; i++) {
- cin >> n;
- for(n; n > 0; n--) {
- cin >> y;
- num.push_back(y);
- }
- cin >> x;
- cout << "Kasus #" << i << ": ";
- z = count(num.begin(), num.end(), x);
- if(z != 0)
- cout << "ADA " << z << " BOTOL DITEMUKAN" << endl;
- else
- cout << "TIDAK ADA" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement