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

TOP

返回列表