Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
165
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Teams
  4. {
  5. internal class Program
  6. {
  7. internal static void Main(string[] args)
  8. {
  9. string[] nums = Console.ReadLine().Split(' ');
  10. string srt1 = nums[0];
  11. string srt2 = nums[1];
  12. int sum = 0;
  13.  
  14. if (srt1.Length > srt2.Length)
  15. {
  16. for (int i = 0; i < srt2.Length; i++)
  17. {
  18. int l = srt1[i];
  19. int r = srt2[i];
  20. sum += l * r;
  21. }
  22. for (int i = srt2.Length; i < srt1.Length; i++)
  23. sum += srt1[i];
  24. }
  25. else
  26. {
  27. for (int i = 0; i < srt1.Length; i++)
  28. {
  29. int l = srt1[i];
  30. int r = srt2[i];
  31. sum += l * r;
  32. }
  33. for (int i = srt1.Length; i < srt2.Length; i++)
  34. sum += srt2[i];
  35. }
  36. Console.WriteLine(sum);
  37. }
  38. }
  39. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement