跳到正文

n_ni

1014022

#include<iosteam>

这是 2026年10月25日 存档的第 1 版,不是当前版本。查看当前版本

资料、奖项与版本

资料

编号
1014022
抓取

奖项

2025 CSP-J
一等奖
2025 CSP-S
一等奖
2024 CSP-J
二等奖
2024 CSP-S
二等奖

版本

  1. v2当前
  2. v1
C++
#include<iosteam>
2379,4455,9250,10199,13379,15457,17248,20311\bold{2379,4455,9250,10199,13379,15457,17248,20311}

神秘剪贴板

tampermonkey

C++
#include<iostream>
#include<string>
using namespace std;
#define uchar unsigned char

uchar buf[1<<20];

void filecopy(string f1,string f2){
	FILE *ifp=fopen(f1.c_str(),"rb");
	FILE *ofp=fopen(f2.c_str(),"wb");
//	system("cls");
	getchar();
//	uchar *p1=buf,*p2=buf;
//	size_t tot=0;
	while(1){
		size_t cnt=fread(buf,1,1<<20,ifp);
		if(cnt==0)break;
		fwrite(buf,1,cnt,ofp);
//		tot+=cnt;
//		string s=to_string(tot)+" byte(s) data has been copied.";
//		setCursorPos(0,0);
//		cout<<s<<"\n";
	}
	cout<<"Completed.\n";
	getchar();
	fclose(ifp);
	fclose(ofp);
} 
C++
#include<iostream>
#include<string>
#include<vector>
using namespace std;
#define uchar unsigned char

uchar buf[1<<20];

void copyfile(string f1,string f2){
	FILE *ifp=fopen(f1.c_str(),"rb");
	FILE *ofp=fopen(f2.c_str(),"wb");
	if(ifp==nullptr||ofp==nullptr)return ;
//	system("cls");
//	uchar *p1=buf,*p2=buf;
//	size_t tot=0;
	while(1){
		size_t cnt=fread(buf,1,1<<20,ifp);
		if(cnt==0)break;
		fwrite(buf,1,cnt,ofp);
//		tot+=cnt;
//		string s=to_string(tot)+" byte(s) data has been copied.";
//		setCursorPos(0,0);
//		cout<<s<<"\n";
	}
//	cout<<"Completed.\n";
	cout<<"[copyfile] "<<f1<<" "<<f2<<" \n";
	fclose(ifp);
	fclose(ofp);
} 

string gtl(){
	string res="";
	char ch;
	while((ch=getchar())&&ch!=EOF){
		if(ch=='\r')continue;
		if(ch=='\n')break;
		res+=ch;
	}
	return res;
}

void mkdir(string name){
	cout<<"[mkdir] "<<name<<"\n";
	string comm="mkdir \""+name+"\" > nul 2>nul";
	system(comm.c_str());
}

string hsh(string s){
	string x16="0123456789abcdef";
	string res="";
	for(int i=0;i<s.size();i++){
		res+=x16[(s[i]>>4)];
		res+=x16[(s[i]&15)];
	}
	return res;
}

void explorer(string path1,string path2){
	mkdir(path2);
	vector<string>dir;
	system(((string)"dir \""+path1+"\" /A-D /B > tmp 2>nul").c_str());
	freopen("tmp","r",stdin);
	string fn;
	while(1){
		fn=gtl();
		if(fn=="")break;
		copyfile(path1+"\\"+fn,path2+"\\"+fn); 
	}
	system(((string)"dir \""+path1+"\" /AD /B > tmp 2>nul").c_str());
	freopen("tmp","r",stdin);
	while(1){
		fn=gtl();
		if(fn=="")break;
		dir.push_back(fn);
	}
	for(auto fn:dir){
		explorer(path1+"\\"+fn,path2+"\\"+fn); 
	}
}

int main(){
	freopen("copy.log","w",stdout);
	string path1,path2;
	path1=gtl(),path2=gtl();
	explorer(path1,path2);
}

2025.12.16 红名祭

2026.4.16 在课后延时使用 3030min 从 11 数到 23792379 (?