#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
char arr[] = "WORLD";
cout << "Enter a letter to search for\n";
char c;
cin >> c;
char* beg = arr;
char* end = arr + sizeof arr;
char* pos = find(beg, end, c);
int cnt = count(beg, end, c);
if(pos == end)
cout << "Not found\n";
else
cout << "The letter " << c << " found " << cnt << " times. "
<< "The first time at position " << 1 + pos - beg << '\n';}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpCnsKICAgIGNoYXIgYXJyW10gPSAiV09STEQiOwogICAgY291dCA8PCAiRW50ZXIgYSBsZXR0ZXIgdG8gc2VhcmNoIGZvclxuIjsKCiAgICBjaGFyIGM7CiAgICBjaW4gPj4gYzsKCiAgICBjaGFyKiBiZWcgPSBhcnI7CiAgICBjaGFyKiBlbmQgPSBhcnIgKyBzaXplb2YgYXJyOwogICAgY2hhciogcG9zID0gZmluZChiZWcsIGVuZCwgYyk7CiAgICBpbnQgY250ID0gY291bnQoYmVnLCBlbmQsIGMpOwoKICAgIGlmKHBvcyA9PSBlbmQpCiAgICAgICAgY291dCA8PCAiTm90IGZvdW5kXG4iOwogICAgZWxzZQogICAgICAgY291dCA8PCAiVGhlIGxldHRlciAiIDw8IGMgPDwgIiBmb3VuZCAiIDw8IGNudCA8PCAiIHRpbWVzLiAiCiAgICAgICAgICAgIDw8ICJUaGUgZmlyc3QgdGltZSBhdCBwb3NpdGlvbiAiIDw8IDEgKyBwb3MgLSBiZWcgPDwgJ1xuJzt9