09毕飞鸟 09毕飞鸟
关注数: 40 粉丝数: 13 发帖数: 363 关注贴吧数: 6
求高手帮忙看看这个程序,《小弟新手》 # include <iostream> # include <cstring> # include <fstream> using main() {      char C;      ifstream infile ("奥巴马演讲稿.txt")      ofstream outfile ("复制文本.txt")      if(!infile ||!outfile)      {          cout<<"文件打开失败!"<<endl;          return 1;      }      int k=0;      char A[20000];      while (!infile.eof())      {          infile get(c);          outfile put(c);          A[k]=C;          k++;      }      infile close();      outfile close();      A[k+1]='\0';      ofstream outfile 2 ("文件倒序.txt");      if(!outfile 2)      {          cout<<"文件打开失败!"<<endl;          return 1;      }      for(int P=k;P>=0;p--)      {          outfile 2<<A[p];      }      outfile 2 close ();      char * word [5000];      int j=0;      int count=0;      for(int t=0;t<strlen(A);t++)      {          if(A[t]>='A'&&A[t]<='Z')          {              A[t]=A[t]+32;          }      }      for(int i=0;i<strlen(A);i++)      {          if(A[i]>='a'&&A[i]<='Z')          {              if(i==strlen(A)-1)              {                  word[count]=new char[20];                  for(int k=j;k<=i;k++)                  {                      word[count][k-j]=A[k];
1 下一页