Program.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. namespace ConsoleApp1;
  2. public class Program
  3. {
  4. public static void Main(string[] args)
  5. {
  6. }
  7. public static bool MinFromTwoNumbers(int a, int b)
  8. {
  9. if (a > b) return true;
  10. return false;
  11. }
  12. public static float MetersToCentimeters(float a)
  13. {
  14. return (a * 100);
  15. }
  16. public static bool AuthorizationMetod1(string login,string password)
  17. {
  18. if (login != password && !string.IsNullOrEmpty(login) && !string.IsNullOrEmpty(password))
  19. {
  20. return true;
  21. }
  22. return false;
  23. }
  24. public static bool AuthorizationMetod2(string login, string password, string email, string date)
  25. {
  26. DateTime date1;
  27. if(!string.IsNullOrEmpty(login) && !string.IsNullOrEmpty(password)
  28. && !string.IsNullOrEmpty(email)
  29. && email.Contains("@gmail.com")
  30. && DateTime.TryParse(date,out date1))
  31. {
  32. return true;
  33. }
  34. return false;
  35. }
  36. public static bool TestDate(string date)
  37. {
  38. DateTime date1;
  39. if (DateTime.TryParse(date, out date1))
  40. {
  41. return true;
  42. }
  43. return false;
  44. }
  45. }