返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<sstream>
  4. using namespace std;
  5. int main()
  6. {
  7.     string str="234.2434.234234.234";
  8.     str+=".";
  9.     string fk[50];
  10.     string th="";
  11.     int ind=0;
  12.     for(int i=0;i<str.size();i++)
  13.     {
  14.         if(str[i]=='.')
  15.         {
  16.             fk[ind]=th;
  17.             th="";
  18.             ind++;           
  19.         }else
  20.         {
  21.             th+=str[i];
  22.         }     
  23.     }
  24.     for(int i=0;fk[i]!="";i++)
  25.     {
  26.        cout<<fk[i]<<endl;     
  27.     }
  28.     system("pause");
  29.         return 0;
  30. }
複製代碼

TOP

返回列表