edgares futch stack overflow code example

Example 1: stack

typedef struct Nodo{
   Elem val;
   struct Nodo *next;
} *Stack;
Stack Empty(){return NULL;}
bool IsEmpty(Stack a){return a==NULL;}
Elem Top(Stack a){return a->val;} 
Stack Pop(Stack l){return l->next;}
Stack Push(Elem x,Stack res){
    Stack nuevo=(Stack)malloc(sizeof(struct Nodo));
    nuevo->val=x;
    nuevo->next=res;
    return nuevo;
}

Example 2: stackoveflosw

` function myFunction() {
  s.getRange(3, 7, 1, 3).clear()
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var s = ss.getSheets()[0];
  s.getRange(3, 7, 1, 3).clear()
  var celda = s.getRange(3, 1).getValue()
  for (var i = 1; i < 13; i++) 
  {
    var bar = s.getRange(i, 2, 1, 3).getValues(); 
    if (celda == s.getRange(i, 2))
    {s.getRange(3, 7, 1, 3).setValues(bar);
    }
  }
}`

Tags:

C Example