#include <stdio.h>
int main( void ) {
const char *string[100000];
const char delims[] = ",";
const char *s = string;
int j =0 ;
int words=0;
FILE *cfPtr;
if ((cfPtr = fopen( "pln.txt", "r" ) ) == NULL )
{
printf( "File could not be opened\n" );
} else {
printf( "File exists\n" );
}
fscanf(cfPtr,"%[^\n]",string);
do {
size_t field_len = strcspn(s, delims);
printf("\"%.*s\"\n", (int)field_len, s);
s += field_len;
printf("%s \n ",s);
words ++;
} while (*s++);
printf("%d No of words \n", words);
fclose(cfPtr);
}
lundi 2 mars 2015
(already figured out how to split strings after a comma ) but cant seem to find no of palindromes
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire