Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
123
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Numerics;
  6. using System.Text;
  7. using System.Text.RegularExpressions;
  8.  
  9. namespace HomeWork
  10. {
  11. class Program
  12. {
  13. static void Main()
  14. {
  15. var strs = Regex.Split(Console.ReadLine(), @"\W+");
  16. var str1 = strs[0];
  17. var str2 = strs[1];
  18. long sum = 0;
  19. for (int i = 0; i < Math.Max(str1.Length, str2.Length); i++)
  20. {
  21. long num1 = 1, num2 = 1;
  22. if (i < str1.Length) num1 = str1[i];
  23. if (i < str2.Length) num2 = str2[i];
  24. sum += num1 * num2;
  25. }
  26. Console.WriteLine(sum);
  27. }
  28. }
  29. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement