跳到正文

个人记录

CSP开代码

CAndrew约 2 分钟
原文
文章信息与版本

文章信息

发布
2026年11月5日
收录
2026年11月28日
更新
2026年11月28日
篇幅
约 2 分钟

版本

  1. v1当前
C++
#include<bits/stdc++.h>

using namespace std;

string ist(int i){
	
	if(i){
		
		return ist(i / 10) + char(i % 10 + 48);
	}
	return "";
}

string add0(int i){
	
	string s = "";
	int n = 4;
	while(i /= 10){
		
		n--;
	}
	while(n--)s+='0';
	return s;
}
string ss, sss, ss1;

const string path1 = "C:\\Users\\user\\Desktop\\answers", path2 = "D:\\subway1500-1600", problem = "hub", province = "GD", difficult = "S";
signed main(){
	
	int nn = 1562;
	
//	for(int i = 1 + nn; i <= nn + 100; i++){
	for(int i = nn; i <= nn; i++){
		
		ss1 = "copy ";
		ss1 += path1 + "\\" + province + "-" + difficult + add0(i) + ist(i) + "\\" + problem + "\\" + problem + ".cpp " + path2 + "\\" + problem + province + difficult + add0(i) + ist(i) + ".cpp";
		char *st2 = const_cast<char *>(ss1.c_str()) ;
		system(st2);
		ss = path2 + "\\" + problem + province + difficult + add0(i) + ist(i) + ".cpp";
		sss = "if exist " + ss + " (start " + ss + ")"; 
		char *st1 = const_cast<char *>(sss.c_str()) ;
		cout << sss << "\n";
//		system();
		system(st1);
	}
	
	return 0;
}
原文