All pastes #938382 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-03-11 16:38 UTC
rendered paste body
#include <Stdio.h>
#include <string.h>

int main()
{
      FILE *s;
      char name[15];
      char leksi[15];
      char c;
      int i,flag=0,N; //N einai to mikos tis leksis

      printf("Dwse to onoma tou arxeiou \n");
      gets(name);
      printf("dwse ti leksi pou thes\n");
      gets(leksi);
      N=strlen(leksi);   
      s=fopen(name,"r");       
      
      if(!s)
      {
          printf("To arxeio den uparxei k to programma thatermatistei\n");
          return -1;
      }
      
      while(!feof(s))
      {
               
                          c=fgetc(s);
                          if((c>='A' && c<= 'Z') || (c>='a' && c<='z'))
                          {
                                           i=0;
                                           while(i<=N && c==leksi[i])                
                                           {                                     
                                           
                                                        c=fgetc(s);
                                                        i++; 
                                           }
                          }
      }
}