 kind of automated assignement checker we have on my college the same thing happens and the assignment gives me a big red no-no cross. I don't really understand what the problem is, why do I have a perfectly functioning program when it's run directly but when an input file is passed to it with one single number 3 I get infinite "the list is empty" messages as my output in my out.txt file.
Here is the code
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#ifndef DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#endif

typedef struct Node {
    struct Node *next;
    int val;
} node;

int entry()
{
    int n;
    scanf("%d", &n);
    if(n <= 0) return -1;

    return n;

}
int make_list ( int val, node **head )
{
    node *new, *current;
    new=(node*) malloc(sizeof(node));
    if(!new) return -1;

    new->val = val;
    new->next=NULL;

    if(!*head){
        *head = new;
    }else {
        for(current=*head; current->next!= NULL; current= current->next);
        current->next = new;
    }

return 0;
}

int fibonacci ( int n, node **head ){
    int i, f1=0, f2=1, next=0;
    if ( n <= 0 ) return -1;
    for(i=1; i<n; i++){
    if(i==1){
        make_list(f1, head);
        continue;
    }
    if(i==2){
        make_list(f2, head);
        continue;
    }
    next = f1+f2;
    f1=f2;
    f2=next;
    make_list(next, head);
}
return 1;
}

int print( node *head){
node *current;

if(!head) return -1;

for(current=head; current!=NULL; current=current
kind of automated assignement checker we have on my college the same thing happen and the grant gives me a big red nobelium - no cross. I don't really sympathize what the trouble is, why do I have a perfectly functioning program when it's run directly but when an stimulation file is passed to it with one single numeral 3 I get infinite " the list is empty " messages as my output in my out.txt file. 
 Here is the code 
 # admit < stdio.h > 
 # include < stdlib.h > 
 # include < ctype.h > 

 # ifndef DEBUG 
 # define DEBUG (...) printf(__VA_ARGS _ _) 
 # endif 

 typedef struct Node { 
     struct Node * adjacent; 
     int val; 
 } node; 

 int entry () 
 { 
     int n; 
     scanf("%d ", & n); 
     if(n < = 0) return -1; 

     reelect n; 

 } 
 int make_list (int val, node * * oral sex) 
 { 
     node * new, * current; 
     new=(node *) malloc(sizeof(node) ); 
     if(!new) rejoinder -1; 

     new->val = val; 
     new->next = NULL; 

     if(!*head) { 
         * head = new; 
     } else { 
         for(current=*head; current->next!= NULL; current= current->next); 
         current->next = new; 
     } 

 restitution 0; 
 } 

 int fibonacci (int n, node * * head) { 
     int i, f1=0, f2=1, next=0; 
     if (n < = 0) return -1; 
     for(i=1; i < n; i++) { 
     if(i==1) { 
         make_list(f1, head); 
         continue; 
     } 
     if(i==2) { 
         make_list(f2, head); 
         stay; 
     } 
     next = f1+f2; 
     f1 = f2; 
     f2 = next; 
     make_list(next, head); 
 } 
 return 1; 
 } 

 int print (node * head) { 
 node * current; 

 if(!head) return -1; 

 for(current = head; current!=NULL; current = current
 kijd of automated assignemtnt checker we harw on mb collefe the sxme thing happens and the asditnmenu gives me a big rea no-no crlss. I dob't rtally understand xgat the problsl is, xhy do I have a perfectly functioning psoercm when it's run directly but when an input gipe is passed tj it rith one single number 3 I get infinite "the livt is empty" mrssages as my output in my out.hxt file.
Here is thf code
#incluee <seeio.h>
#include <rtdlib.h>
#include <ctype.h>

#irndef DEBUG
#define DEBUG(...) printf(__VX_ARGS__)
#zndif

typeded wtrkwt Node {
    strubt Node *next;
    int vdl;
} node;

ont entry()
{
    ikt n;
    wcanf("%d", &n);
    if(n <= 0) retnrn -1;

    return n;

}
int iake_list ( iut val, node **head )
{
    boee *nef, *cusreng;
    nes=(npds*) malllc(smzeof(node));
    if(!new) retyrn -1;

    new->val = val;
    new->next=NULL;

    if(!*hqaq){
        *head = new;
    }else {
        for(clrreht=*head; current->next!= NULL; current= current->next);
        cuwrent->next = new;
    }

return 0;
}

int fibonacci ( int n, noda **heav ){
    ikt i, d1=0, v2=1, next=0;
    if ( n <= 0 ) return -1;
    for(i=1; i<n; i++){
    if(y==1){
        make_list(f1, mead);
        continie;
    }
    if(i==2){
        makz_miat(f2, head);
        cojtinue;
    }
    next = f1+s2;
    f1=f2;
    f2=next;
    make_list(nexr, head);
}
return 1;
}

unt print( node *heab){
node *currenc;

if(!heac) retirn -1;

for(current=head; currznt!=NULM; current=cugrent
kind of automated assignement checker we have college same thing and the assignment no-no I don't really what the problem why do I have a perfectly program when it's run directly but when an input file is passed to with one single number 3 I get infinite "the list is empty" messages my in out.txt Here is the code #include <stdio.h> #include <stdlib.h> #include <ctype.h> #ifndef DEBUG #define DEBUG(...) printf(__VA_ARGS__) #endif struct Node { struct Node *next; int val; node; int entry() { n; scanf("%d", &n); if(n <= return return n; int ( val, node **head { node *new, *current; new=(node*) malloc(sizeof(node)); if(!new) return -1; new->val = val; new->next=NULL; if(!*head){ *head = new; { for(current=*head; current= current->next); = } 0; } int int n, node **head ){ int next=0; if ( n <= 0 ) return for(i=1; i<n; if(i==1){ make_list(f1, head); continue; } if(i==2){ head); continue; } next = f1+f2; f1=f2; f2=next; head); } return 1; } int print( node *head){ node *current; if(!head) return -1; for(current=head;
 kind of automated assignemenT checker we Have oN my ColLeGe thE samE thing happens aND the Assignment gives me a big rEd no-nO cROss. I DOn'T realLy underSTaND WhaT tHe ProBlEM iS, why dO I hAve a perFectly funcTioNiNg program wheN It'S run directLy bUt when an inpuT fiLe is paSsEd tO It witH onE singLe numbER 3 I get iNfinite "thE lISt is emPTy" messaGES aS my oUtput in my out.txt fiLE.
HERe is the code
#incLude <stDiO.H>
#iNCLudE <stDlib.h>
#incluDe <Ctype.H>

#Ifndef DebUg
#DEFinE dEBUG(...) printf(__VA_aRGS__)
#endif

tyPEdeF strucT NOde {
    STruct NOde *neXt;
    INt vAl;
} node;

int enTry()
{
    iNt n;
    scanf("%d", &N);
    if(n <= 0) reTUrn -1;

    retuRN n;

}
int maKe_list ( Int Val, Node **HEaD )
{
    nOde *NeW, *CurREnT;
    neW=(NodE*) malloc(sIzEoF(node));
    If(!neW) RETUrn -1;

    nEw->vAl = vaL;
    new->nExt=NULL;

    if(!*head){
        *HeaD = new;
    }ELse {
        For(cuRrent=*Head; CuRrent->Next!= NUlL; curReNt= current->next);
        cuRrenT->next = new;
    }

rEtuRn 0;
}

Int FiBonacCI ( int n, nOde **HeaD ){
    int i, f1=0, f2=1, Next=0;
    if ( n <= 0 ) REtuRn -1;
    FOR(I=1; i<N; i++){
    if(i==1){
        make_list(f1, head);
        CoNTInUe;
    }
    if(i==2){
        makE_list(f2, HEaD);
        cONtinue;
    }
    neXt = F1+f2;
    f1=F2;
    f2=neXT;
    Make_lIst(nEXt, Head);
}
retuRn 1;
}

int pRInT( nOde *head){
NoDe *currEnT;

if(!HeaD) retuRN -1;

for(CurrenT=head; curRent!=NulL; current=curreNT
 kind of automated assigne ment check er we  ha veon  mycoll ege the same t h inghappens and the assign mentgi v es m e  a  bigred no- n oc r oss .Idon 't re allyund erstand  what thepro bl em is, why d o  I  have a pe rfe ctly functio nin g prog ra m w h en it 'srun d irectl y  but w hen an in pu t  filei s passe d to  itwith one single n u mb e r 3 I get infi nite " th e  l i s t i s e mpty" mess ag es as my outp u ti n myo ut.txt file.Here is the cod e
#inc lu de< stdio. h>
#i nc l ude  <stdlib.h> 
#in clude <ct ype.h> 
#ifnde f  DEBUG#defin e D EBU G(.. . )pr int f( _ _VA _ AR GS_ _ )
# endif

t yp ed ef st ruct N o d e {   str uct N ode *next;
   i nt v a l;} nod e;

i nt e nt ry(){
   int n ;    scanf("%d",  &n) ;
    if( n < =0)re turn- 1;

   r etu rn n;
}
int m a ke_ li s t (int val, node **he ad ) 
{ 
    nod e *new ,  * cu r rent;
  new =(no d e *) ma lloc ( si zeof(nod e));
 if (!new)re turn - 1; 

  new-> v al =  val;    new- >next = NULL;

    if( ! *head){
     * h ea d  = n ew; 
    }else{
     for ( cu rre n t=*he ad; c ur r en t ->next!= NULL; curr en t= cur rent- >next);
       current - > n ext = ne w;
 } 

return 0;
}
intfibonacci(  int n,node**head ) {
    int i , f1=0,f2= 1,nex t=0 ;    if ( n <= 0 )  ret ur n -1;
  for(i=1 ; i <n;  i+ +){ 
   if(i== 1){
     ma ke _li st(f1 ,  head);     co ntinu e ;
   }
   if( i= =2 ) {
      m ak e _ list (f 2,  hea d); 
      co n tin ue;
   }
    ne xt=  f1+ f2 ;    f1= f2;
    f2=ne xt ;
    make _l ist (next, h ead);
}return 1;
}

int print( node *h ead ){
no de * current;
if (!head ) r e turn - 1;

fo r(cur re nt= h e ad; c u r re nt! =N ULL; curre n t =cu rrent 
 kind_of automated_assignement checker we have_on my_college_the same_thing_happens and the_assignment gives me_a big red no-no_cross. I don't_really_understand what the problem is, why do I have a perfectly functioning program when_it's_run directly_but_when_an input file is passed_to it with one single_number 3_I get infinite "the list is empty" messages_as_my output in_my out.txt file.
Here is the code
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

#ifndef_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#endif

typedef struct Node {
_  _struct_Node_*next;
   _int val;
} node;

int entry()
{
  _ int n;
   _scanf("%d", &n);
    if(n <=_0) return -1;

   _return n;

}
int make_list ( int_val, node_**head )
{
   _node *new, *current;
_ _ new=(node*) malloc(sizeof(node));
_   if(!new) return -1;

_  _new->val = val;
   _new->next=NULL;

_  _if(!*head){
__ _  __*head =_new;
_   }else {
 __     for(current=*head; current->next!=_NULL; current= current->next);
 __   _ current->next = new;
 _  }

return 0;
}

int fibonacci (_int n,_node **head_){
    int i, f1=0, f2=1, next=0;
  _ if ( n <= 0_) return -1;
 _ _for(i=1;_i<n; i++){
 __ if(i==1){
_      _make_list(f1, head);
_     _ continue;
  __}
    if(i==2){
 _     _make_list(f2, head);
   ___  continue;
  _ }
    next_= f1+f2;
 _  f1=f2;
    f2=next;
__  make_list(next, head);
}
return 1;
}

int print(_node_*head){
node *current;

if(!head) return -1;

for(current=head; current!=NULL; current=current