Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text;
- using System.Numerics;
- namespace _04_Exc_CharacterMultiplier
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<string> input = Console.ReadLine().Split().ToList();
- List<char> str1 = input[0].ToList();
- List<char> str2 = input[1].ToList();
- int sum = 0;
- if (str1.Count < str2.Count)
- {
- int count = str2.Count - str1.Count;
- for (int i = 0; i < count; i++)
- {
- str1.Add((char)1);
- }
- }
- if (str1.Count > str2.Count)
- {
- var count = str1.Count - str2.Count;
- for (int i = 0; i < count ; i++)
- {
- str2.Add((char)1);
- }
- }
- for (int i = 0; i < str2.Count; i++)
- {
- var variable = str1[i];
- sum += str1[i] * str2[i];
- }
- Console.WriteLine(sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement