ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1567. SMS-spam

С# Solution
Posted by Lada Belonogova 18 Jan 2019 13:22
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace phrase
{
class Program
{
static int First(string input, string[]array)
{
int col = Convert.ToInt32(input.Length);
if (col>0&&col<=1000)
{
int countArr = 0,countStr = 0,c = Convert.ToInt32(array.Length),count = 0,indexStr=0;
for (; countArr < c; countArr++)
{
for (; (indexStr = input.IndexOf(array[countArr], countStr)) !=-1; countStr = indexStr + 1)
{
count++;
}
countStr = 0;
}
return count;
}
return 0;
}
static void Main(string[] args)
{
string[] one = new string[] { "a", "d", "g", "j", "m", "p", "s", "v", "y", ".", " " };
string[] two= new string[] { "b", "e", "h", "k", "n", "q", "t", "w", "z", "," };
string[] three = new string[] { "c", "f", "i", "l", "o", "r", "u", "x", "!" };