Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _2214
- {
- class Program
- {
- static void Main(string[] args)
- {
- int a, b, k = 0, ac = 0, bc = 0, c, d;
- a = int.Parse(Console.ReadLine());
- b = int.Parse(Console.ReadLine());
- c = a;
- d = b;
- while ( c > 0 )
- {
- c /= 10;
- ac++;
- }
- while ( d > 0 )
- {
- d /= 10;
- bc++;
- }
- if (ac == bc)
- {
- while (a > 0 && b > 0)
- {
- if (a % 10 == b % 10)
- {
- k++;
- }
- a /= 10;
- b /= 10;
- }
- Console.WriteLine("DA");
- Console.WriteLine(k);
- }
- else
- Console.WriteLine("NU");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement