- #include<iostream>
- #include<cstdlib>
- #include<sstream>
- using namespace std;
- int main()
- {
- string str="234.2434.234234.234";
- str+=".";
- string fk[50];
- string th="";
- int ind=0;
- for(int i=0;i<str.size();i++)
- {
- if(str[i]=='.')
- {
- fk[ind]=th;
- th="";
- ind++;
- }else
- {
- th+=str[i];
- }
- }
- for(int i=0;fk[i]!="";i++)
- {
- cout<<fk[i]<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |