#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
int main()
{
string url("https://legacy.cplusplus.com/reference/atomic/");
size_t pos1 = url.find(':');
string url1 = url.substr(0, pos1 - 0);
cout << url1 << endl;
size_t pos2 = url.find('/',pos1+3);
string url2 = url.substr(pos1 + 3,pos2-(pos1+3));
cout << url2 << endl;
string url3 = url.substr(pos2+1);
cout << url3 << endl;
return 0;
}
分割一段网址(url)
于 2024-09-11 21:16:09 首次发布