Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- class Program {
- public static int Main() {
- Console.Write("Введите строку : ");
- string S = Console.ReadLine();
- char ch = 'c';
- // int count = S.Where(a => a.ToString() == ch).ToList().Count();
- //Console.WriteLine(count);
- int res = 0;
- for(int i = 0; i < S.Length; i++) {
- if(S[i] == ch) res++;
- }
- Console.WriteLine(res);
- Console.ReadKey();
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement