Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Unit4.CollectionsLib;
- using System.Linq;
- using System.Text;
- namespace Lab_18_02
- {
- class Program
- {
- public static bool CheckPolydrom(int n)
- {
- string st = n.ToString();
- for (int i = 0; i < st.Length / 2; i++)
- if (st[i] != st[st.Length - i - 1])
- return false;
- return true;
- }
- public static bool NodePolyndrom(Node<int> n)
- {
- Stack<int> s = new Stack<int>();
- if (n == null)
- return false;
- while (n!= null && n.GetInfo() != 0)
- {
- s.Push(n.GetInfo());
- n = n.GetNext();
- }
- if (n == null)
- return false;
- n = n.GetNext();
- while (n != null)
- {
- if (s.Pop() != n.GetInfo())
- return false;
- if (!CheckPolydrom(n.GetInfo()))
- return false;
- n = n.GetNext();
- }
- return true;
- }
- static void Main(string[] args)
- {
- DateTime t;
- while (true)
- {
- t = DateTime.Now;
- t = t.AddMinutes(-44);
- if (t.Hour < 10)
- Console.Write("0");
- Console.Write(t.Hour + ":");
- if (t.Minute < 10)
- Console.Write("0");
- Console.Write(t.Minute + ":");
- if (t.Second < 10)
- Console.Write("0");
- Console.WriteLine(t.Second);
- System.Threading.Thread.Sleep(1000);
- Console.Clear();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement