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 Exam01
- {
- class Program
- {
- static int mult(int m, int n)
- {
- if (n == 1)
- {
- return m;
- }
- return mult(m, n - 1) + m;
- }
- static void Main(string[] args)
- {
- int[] numbers = Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToArray();
- int result = mult(numbers[0], numbers[1]);
- Console.WriteLine(result);
- /* Ex.1
- int[] vaulchers = { 100, 20 };
- int days = int.Parse(Console.ReadLine());
- int money = days * 20;
- int i = 0;
- int count = 0;
- while (money != 0)
- {
- while (money - vaulchers[i] >= 0)
- {
- money -= vaulchers[i];
- count++;
- }
- i++;
- }
- Console.WriteLine(count);*/
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement