Advertisement
vencinachev

Exams

Oct 23rd, 2022
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Exam01
  8. {
  9. class Program
  10. {
  11. static int mult(int m, int n)
  12. {
  13. if (n == 1)
  14. {
  15. return m;
  16. }
  17. return mult(m, n - 1) + m;
  18. }
  19.  
  20. static void Main(string[] args)
  21. {
  22. int[] numbers = Console.ReadLine().Split(' ').Select(n => int.Parse(n)).ToArray();
  23. int result = mult(numbers[0], numbers[1]);
  24. Console.WriteLine(result);
  25. /* Ex.1
  26. int[] vaulchers = { 100, 20 };
  27. int days = int.Parse(Console.ReadLine());
  28. int money = days * 20;
  29. int i = 0;
  30. int count = 0;
  31. while (money != 0)
  32. {
  33. while (money - vaulchers[i] >= 0)
  34. {
  35. money -= vaulchers[i];
  36. count++;
  37. }
  38. i++;
  39. }
  40. Console.WriteLine(count);*/
  41.  
  42. }
  43. }
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement