Данный отчёт сгенерирован 04.04.2023 06:21:13 UTC.
HTML версия (этот сайт) сгенерирован 04.04.2023 06:21:31 UTC.
Коммит: [bfeb65b9] add automatic zip creation 04.04.2023 06:21:13
HTML версия (этот сайт) сгенерирован 04.04.2023 06:21:31 UTC.
Коммит: [bfeb65b9] add automatic zip creation 04.04.2023 06:21:13
Задача: Дивний Індексатор
04.04.2023 06:21:13
Описание: Оголосіть клас Strange, який інкапсулює рядок та має індексатор, що визначає за символом
кількість входжень цього символу в рядок. Наприклад,
Strange s = new Strange("abcbabcb");
s['a'] == 2
s['b'] == 4
s['d'] == 0
04.04.2023 06:21:13
Решений: 31
04.04.2023 06:21:13
Дивний Індексатор
04.04.2023 06:21:13
class Strange
{
char[] cs;
public Strange(string s)
{
cs = s.ToCharArray();
}
public int this[char i]
{
get
{
int count = 0;
for (int j = 0; j < cs.Length; j ++)
{
if (cs[j] == i)
{
count ++;
}
}
return count;
}
}
}
class Strange
{
private string st;
public Strange(string str)
{
st = str;
}
public int this[char q]
{
set{}
get
{
int count = 0;
for(int i = 0;i< st.Length;i++)
{
if(st[i] == q ) count++;
}
return count;
}
}
}
class Strange
{
string str;
public Strange(string str)
{
this.str = str;
}
public int this[char symbol]
{
get{
int quantity = 0;
for(int i = 0; i < str.Length; i++)
if(str[i] == symbol) quantity++;
return quantity;
}
}
}
public class Strange
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
class Strange
{
string str;
public Strange(string str)
{
this.str = str;
}
public int this[char i]
{
get {
int counter = 0;
foreach (var item in str)
{
if (item == i)
counter++;
}
return counter;
}
}
}
class Strange
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
class Strange
{
string s;
public Strange(string s)
{
this.s = s;
}
public int this[char c]
{
get { return s.Count(ch => ch == c); }
}
}
class Strange {
string chars;
public Strange(string str) {
chars = str;
}
public int this[char s] {
get {
int count = 0;
for(int i =0; i < chars.Length; i++) {
if (chars[i] == s) {
count++;
}
}
return count;
}
}
}
class Strange{
char[] a;
int count = 0;
public Strange(string s){
a = s.ToCharArray();
}
public int this[char c]{
get{return count;}
set{foreach(var i in a) count = i==c ? count++ : count;}
}
}
class Strange
{
public string St;
private Dictionary< char, int> dic;
public Strange(string value)
{
St = value;
dic = new Dictionary< char, int>();
foreach(char ch in St)
{
if(!dic.ContainsKey(ch)){
dic.Add(ch, 1);
}
else{
dic[ch]++;
}
}
}
public int this[char ch]
{
get {
if(dic.ContainsKey(ch)) return dic[ch];
return 0;
}
}
}
class Strange {
private string str;
public Strange(string str) {
this.str = str;
}
public int this[char s] {
get {
int count = 0;
for(int i = 0; i < str.Length; i++)
if(str[i] == s) count++;
return count;
}
}
}
public class Strange {
private string S;
public Strange(string s) {
S = s;
}
public int this[char c] {
get { return S.Count(x => x == c); }
}
}
class Strange
{
string s;
int kilk = 0;
public Strange(string s)
{
this.s = s;
}
public int this[ char elm]
{
get
{
for (int i = 0; i < s.Length; i++)
{
if (elm == s[i]) kilk++;
}
return kilk;
}
}
}
public class Strange
{
private string str;
public Strange(string str)
{
this.str = str;
}
public int this[char ch]
{
get
{
int counter = 0;
foreach (char s in str)
{
if(s == ch){
counter += 1;
}
}
return counter;
}
}
}
class Strange
{
private string s;
public Strange(string s)
{
this.s = s;
}
public int this[char index]
{
get
{
int count = 0;
for(int i = 0; i < s.Length; i++)
{
if (s[i] == index) count++;
}
return count;
}
}
}
public class Strange
{
public string Value { get; }
public Strange(string value)
{
Value = value;
}
public int this[char c]
{
get { return Value.Count(ch => ch == c); }
}
}
class Strange
{
private string _string;
public Strange(string s)
{
_string = s;
}
public int this[char el]
{
get => CountChar(el);
}
public int CountChar(char el)
{
int count = 0;
foreach(var e in _string)
{
if(e == el)
{
count ++;
}
}
return count;
}
}
public class Strange{
public string ss;
public Strange(string s){
this.ss=s;
}
public int CheckChar(char c){
int res = 0;
for(int i=0;i< ss.Length;i++){
if(ss[i]==c){
res++;
}
}
return res;
}
public int this[char c]{
get{return CheckChar(c);}
}
}
class Strange
{
private string _str;
public Strange(string str)
{
_str = str;
}
public int this[char letter]
{
set { }
get { return CountOfLetters(letter); }
}
private int CountOfLetters(char letter)
{
int count = 0;
foreach (char letters in _str)
{
if (letters == letter) count++;
}
return count;
}
}
class Strange {
private string str;
public Strange(string s) {
str = s;
}
public int this[char c] {
get {
int count = 0;
foreach (char ch in str)
if (ch == c) count++;
return count;
}
}
}
class Strange
{
private string str;
public Strange (string str)
{
this.str = str;
}
public int this[char ch]
{
get
{
int Count = 1;
foreach (char element in str)
{
_ = element == ch ? Count++ : 0;
}
return Count;
}
}
}
class Strange {
private string s;
public Strange(string value) {
s = value;
}
public int this[char value] {
get {
int count = 0;
for(int i = 0; i < s.Length; i++) {
if(s[i] == value)
count++;
}
return count;
}
}
}
public class Strange
{
private string str;
public Strange(string str)
{
this.str = str;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
public class Strange
{
private readonly string _str;
public Strange(string str)
{
_str = str;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in _str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
public class Strange
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char val in str)
{
if (val == c)
{
count++;
}
}
return count;
}
}
}
class Strange{
private string str;
public Strange(string s){
str=s;
}
int count=0;
public int this[char a]
{
set{
for(int i=0;i< str.Length;i++){
if(str[i]==a)
count++;
}
}
get{
return count;
}
}
}
public class Strange
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get { return str.Count(x => x == c); }
}
}
class Strange
{
private readonly string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
class Strange
{
private string str;
public Strange(string str)
{
this.str = str;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count += 1;
}
}
return count;
}
}
}
public class Strange
{
private string s;
public Strange(string s)
{
this.s = s;
}
public int this[char c]{
get {
int Count = 0;
for (int i = 0; i < s.Length; i++) { if (s[i] == c) { Count = i; } }
return Count;
}
}
}
class Strange
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char a]
{
get
{
return str.Count(b => b == a);
}
}
}
{
char[] cs;
public Strange(string s)
{
cs = s.ToCharArray();
}
public int this[char i]
{
get
{
int count = 0;
for (int j = 0; j < cs.Length; j ++)
{
if (cs[j] == i)
{
count ++;
}
}
return count;
}
}
}
{
private string st;
public Strange(string str)
{
st = str;
}
public int this[char q]
{
set{}
get
{
int count = 0;
for(int i = 0;i< st.Length;i++)
{
if(st[i] == q ) count++;
}
return count;
}
}
}
{
string str;
public Strange(string str)
{
this.str = str;
}
public int this[char symbol]
{
get{
int quantity = 0;
for(int i = 0; i < str.Length; i++)
if(str[i] == symbol) quantity++;
return quantity;
}
}
}
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
{
string str;
public Strange(string str)
{
this.str = str;
}
public int this[char i]
{
get {
int counter = 0;
foreach (var item in str)
{
if (item == i)
counter++;
}
return counter;
}
}
}
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
{
string s;
public Strange(string s)
{
this.s = s;
}
public int this[char c]
{
get { return s.Count(ch => ch == c); }
}
}
string chars;
public Strange(string str) {
chars = str;
}
public int this[char s] {
get {
int count = 0;
for(int i =0; i < chars.Length; i++) {
if (chars[i] == s) {
count++;
}
}
return count;
}
}
}
char[] a;
int count = 0;
public Strange(string s){
a = s.ToCharArray();
}
public int this[char c]{
get{return count;}
set{foreach(var i in a) count = i==c ? count++ : count;}
}
}
{
public string St;
private Dictionary< char, int> dic;
public Strange(string value)
{
St = value;
dic = new Dictionary< char, int>();
foreach(char ch in St)
{
if(!dic.ContainsKey(ch)){
dic.Add(ch, 1);
}
else{
dic[ch]++;
}
}
}
public int this[char ch]
{
get {
if(dic.ContainsKey(ch)) return dic[ch];
return 0;
}
}
}
private string str;
public Strange(string str) {
this.str = str;
}
public int this[char s] {
get {
int count = 0;
for(int i = 0; i < str.Length; i++)
if(str[i] == s) count++;
return count;
}
}
}
private string S;
public Strange(string s) {
S = s;
}
public int this[char c] {
get { return S.Count(x => x == c); }
}
}
{
string s;
int kilk = 0;
public Strange(string s)
{
this.s = s;
}
public int this[ char elm]
{
get
{
for (int i = 0; i < s.Length; i++)
{
if (elm == s[i]) kilk++;
}
return kilk;
}
}
}
{
private string str;
public Strange(string str)
{
this.str = str;
}
public int this[char ch]
{
get
{
int counter = 0;
foreach (char s in str)
{
if(s == ch){
counter += 1;
}
}
return counter;
}
}
}
{
private string s;
public Strange(string s)
{
this.s = s;
}
public int this[char index]
{
get
{
int count = 0;
for(int i = 0; i < s.Length; i++)
{
if (s[i] == index) count++;
}
return count;
}
}
}
{
public string Value { get; }
public Strange(string value)
{
Value = value;
}
public int this[char c]
{
get { return Value.Count(ch => ch == c); }
}
}
{
private string _string;
public Strange(string s)
{
_string = s;
}
public int this[char el]
{
get => CountChar(el);
}
public int CountChar(char el)
{
int count = 0;
foreach(var e in _string)
{
if(e == el)
{
count ++;
}
}
return count;
}
}
public string ss;
public Strange(string s){
this.ss=s;
}
public int CheckChar(char c){
int res = 0;
for(int i=0;i< ss.Length;i++){
if(ss[i]==c){
res++;
}
}
return res;
}
public int this[char c]{
get{return CheckChar(c);}
}
}
{
private string _str;
public Strange(string str)
{
_str = str;
}
public int this[char letter]
{
set { }
get { return CountOfLetters(letter); }
}
private int CountOfLetters(char letter)
{
int count = 0;
foreach (char letters in _str)
{
if (letters == letter) count++;
}
return count;
}
}
private string str;
public Strange(string s) {
str = s;
}
public int this[char c] {
get {
int count = 0;
foreach (char ch in str)
if (ch == c) count++;
return count;
}
}
}
{
private string str;
public Strange (string str)
{
this.str = str;
}
public int this[char ch]
{
get
{
int Count = 1;
foreach (char element in str)
{
_ = element == ch ? Count++ : 0;
}
return Count;
}
}
}
private string s;
public Strange(string value) {
s = value;
}
public int this[char value] {
get {
int count = 0;
for(int i = 0; i < s.Length; i++) {
if(s[i] == value)
count++;
}
return count;
}
}
}
{
private string str;
public Strange(string str)
{
this.str = str;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
{
private readonly string _str;
public Strange(string str)
{
_str = str;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in _str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char val in str)
{
if (val == c)
{
count++;
}
}
return count;
}
}
}
private string str;
public Strange(string s){
str=s;
}
int count=0;
public int this[char a]
{
set{
for(int i=0;i< str.Length;i++){
if(str[i]==a)
count++;
}
}
get{
return count;
}
}
}
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get { return str.Count(x => x == c); }
}
}
{
private readonly string str;
public Strange(string s)
{
str = s;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count++;
}
}
return count;
}
}
}
{
private string str;
public Strange(string str)
{
this.str = str;
}
public int this[char c]
{
get
{
int count = 0;
foreach (char ch in str)
{
if (ch == c)
{
count += 1;
}
}
return count;
}
}
}
{
private string s;
public Strange(string s)
{
this.s = s;
}
public int this[char c]{
get {
int Count = 0;
for (int i = 0; i < s.Length; i++) { if (s[i] == c) { Count = i; } }
return Count;
}
}
}
{
private string str;
public Strange(string s)
{
str = s;
}
public int this[char a]
{
get
{
return str.Count(b => b == a);
}
}
}