Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace AiSD1
- {
- class Program
- {
- void PUSH(int x, int[] S)
- {
- int n = 0;
- while(S[n] != -1)
- {
- n++;
- }
- S[n] = x;
- }
- bool POP(int[] S)
- {
- if (!ISEMPTY(S))
- {
- int n = 0;
- while (S[n] != -1)
- {
- n++;
- }
- S[n] = -1;
- return true;
- }
- else
- {
- return false;
- }
- }
- bool ISEMPTY(int[] S)
- {
- if(S[0] == -1)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- void CLAER(int[] S)
- {
- int n = 0;
- while (S[n] != -1)
- {
- n++;
- S[n] = -1;
- }
- }
- int TOP(int[] S)
- {
- int n = 0;
- while (S[n] != -1)
- {
- n++;
- }
- return S[n - 1];
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Hello World!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement