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 _07.Multiply_Big_Number
- {
- class Program
- {
- static void Main(string[] args)
- {
- var firstStr = Console.ReadLine();
- var secondStr = Console.ReadLine();
- var multiplyResult = 0;
- var reminder =0;
- string newNumber = string.Empty;
- for (int i = firstStr.Length-1; i>=0; i--)
- {
- int value = (firstStr[i] - 48) * (secondStr[0]-48) + reminder;
- //Console.WriteLine(value);
- if (value>9)
- {
- reminder = value / 10; //Console.WriteLine(reminder);
- value = value % 10; //Console.WriteLine(value);
- }
- newNumber += value;
- }
- if (reminder != 0) newNumber += reminder;
- newNumber = new string(newNumber.Reverse().ToArray());
- Console.WriteLine(newNumber);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement