范围切记要小,小心卡崩

视奸别人

#include <bits/stdc++.h>
using namespace std; 
int getit(int l,int r){
	int kill;
	do{
		cin >> kill;
		if(kill>r||kill<l){
			cout << "输入给我输入好的啊," << l << "~" << r << '\n';
		}
	} while(kill<l||kill>r);
	return kill;
}
string tostr(int x){
    if (x == 0) return "0";
    bool neg = false;
    long long lx = x; 
    if(lx < 0){
        neg = true;
        lx = -lx;
    }
    string res;
    while(lx > 0){
        res += (char)('0' + (lx % 10));
        lx /= 10;
    }
    if(neg) res += '-';
    reverse(res.begin(), res.end());
    return res;
}
int main(){
    int mod, l, r;
    cout << "1为博客,2为用户: ";
    mod=getit(1,2);
    cout << "范围起始 l: ";
    l=geiit(1,9999);
    cout << "范围结束 r: ";
    r=geiit(l,9999);
    for(int i = l; i <= r; i++){
        string s;
        if(mod == 1) s = "start https://xwjedu.cn/blog/";
        else s = "start https://xwjedu.cn/user/";
        s += tostr(i);
        system(s.c_str()); 
    }
    return 0;
}