第一题: 
http://www.baidu.com/img/logo.gif (不断变化) 做出程序使 该字符串 拆分最后得到 logo.gif 第二题: 
Down FileName FilePath  
做出程序使 该字符串分离出 FileName 和FilePath 记住那里是有空格的.. 散分咯 开谁做的最优化  :)

解决方案 »

  1.   

    从后向前
    首先将某char*p指向字符串末尾
    然后向前
    1.当遇到'/',结束,cout<<p+1
    2.当遇到' ',cout<<p+1
    将*p='\0',继续向前,当遇到' ',cout<<p+1,结束
      

  2.   

    CString str(_T("http://www.baidu.com/img/logo.gif "));
    CString str1= str.Right(str.GetLength() - str.ReverseFind('/')-1);
      

  3.   

    CString str(_T("http://www.baidu.com/img/logo.gif "));
    str.Delete(0, str.ReverseFind('/')+1);
      

  4.   

    不对,最快的应该只遍历一遍
    #include <iostream.h>void main(){
    char ch[]="http://www.baidu.com/img/logo.gif";
    char * p;
    char * s;
    s=p=ch;
    while(1){

    while(*p!='/'){
    if(*p=='\0')
    goto L;
    p++;
    }
    s=++p;
    }
    L: cout<<s;
    }
    竟然不知道该如何跳出循环了,只好用goto第二个差不多也是这样