回覆列表
  • 1 # XIaoPan

    void cut(string &str)

    {

    int n=0;

    n=str.size()-1;

    string cutter(n," ");

    string str3(n," ");

    string dian=".";

    int i=0;

    int j=0;

    while(str[i]!=NULL)

    {

    if (str[i]==dian[0])

    {

    for (int k=0;k<=n-i+1;k++)

    {

    str3[k]=str[i+1+k];

    }

    break;

    }

    else

    {

    cutter[i]=str[i];

    i++;

    }

    }

    cout<<cutter<<endl;

    cout<<str3<<endl;

    }

  • 中秋節和大豐收的關聯?
  • C語言基本整型的資料範圍什麼意思?