Home > Back-end >  The code I wrote out in Visual C runtime system no error but run it always automatically exit hope t
The code I wrote out in Visual C runtime system no error but run it always automatically exit hope t

Time:10-26

[problem description] : enter a page of text, can be simple editing and statistics,
[] function:
1), a page from storage, N lines, a maximum of 80 columns
2), the number of the statistics of letters, Numbers, Spaces and the number of words in full
3), the realization of a string of letters switch
4), the realization of string search and replace function
#include # include & lt; String. H> Typedef struct line {char * data; Struct line * next; } the LINE; Void PrintfWord (LINE * head) {LINE * p=head; int j=0; Int length=strlen (p - & gt; The data); for(int i=0; i<=length; I++) {printf (" % c ", p - & gt; The data); j++; If (j %==0 80) printf (" \ n "); }} to void the create (LINE * head) {printf (" please enter a page article: \ n "); The LINE * p=new LINE; The head=p; Int length=strlen (p - & gt; The data); for(int i=0; i<=length; I++) {the scanf (" % c ", & amp; P - & gt; The data); If (length> 80) {printf (" input a maximum of 80 characters per line \ n "); break; } p - & gt; Next=NULL; The head=head - & gt; next; {}} int NumWord (LINE * head) LINE * p=head; int i; char ch; Int length=strlen (p - & gt; The data); Int NumWord; Ch=p - & gt; Data [I]; While ((ch!='\ 0') & amp; & (length<{80)) for (I=0; i<=length; I++) {ch=p - & gt; Data [I]; If ((ch>='a' & amp; & Ch<='z') | | (ch>='A' & amp; & Ch<=NumWord++ 'Z')); }} return NumWord; {} int Number (LINE * head) LINE * p=head; int i; char ch; Int length=strlen (p - & gt; The data); int Number; Ch=p - & gt; Data [I]; While ((ch!='\ 0') & amp; & (length<{80)) for (I=0; i<=length; I++) {ch=p - & gt; Data [I]; If (ch>='0' & amp; & Ch
  • Related