Advertisement
nahidjamalli

Lesson #12

Apr 14th, 2020
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. class PipeServer
  4. {
  5.     static void Main()
  6.     {
  7.         string J = Console.ReadLine();
  8.         string S = Console.ReadLine();
  9.  
  10.         int count = 0;
  11.         foreach (var j in J)
  12.         {
  13.             foreach (var s in S)
  14.                 if (j == s)
  15.                 {
  16.                     count++;
  17.                 }
  18.         }
  19.  
  20.         Console.WriteLine(count);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement