1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
init();
return 0;
}
int init()
{
int a=0,b=0,c,cc,d,e,f,i,j=0;
char ch[20];
char word[20][1000];
char sign[]={' ',',','.','-','!','?'};
FILE *fl;
fl=fopen("text.txt","r");
if(fl==NULL)
{
printf("Error 404: no file found.\n");
system("PAUSE");
return 0;
}
while(!feof(fl))
{
fscanf(fl,"%c",ch);
for(d=0;d<sizeof(ch);d++)
{
for(c=0;c<sizeof(sign);c++)
{
if(ch[d]==sign[c])
{
b=b+1;
}
}
}
cc=b;
b=0;
for(d=0;d<sizeof(ch);d++)
{
word[d][b]=ch[d];
}
printf("%c",word[d][b]);
}
printf("\n");
system("PAUSE");
}
|