隐藏页面特效

[黑科技]

1|0自动AC机


1|1只能在lemon中用


#ifndef __linux__ #include<windows.h> #endif //#include<cstdlib> //#include<syspes.h> //#include<unistd.h> #include<dirent.h> #include<string> #include<vector> #include<cstring> #include<algorithm> using namespace std; string f=__FILE__; int n,l; typedef std::pair<int,string> p; vector<p>v; char s[1000]; inline char*rread(int&r,char*s) { r=0; while(*s<'0'||*s>'9')s--; for(int b=1; *s>='0'&&*s<='9'; b*=10,s--) r+=b*(*s-'0'); return s; } #include<iostream> int main() { f=f.substr(0,f.find_last_of('.',f.length())); #ifdef __linux__ DIR*dir=opendir(("../../data/"+f).c_str()); dirent*ptr; while((ptr=readdir(dir))!=NULL) if((l=strlen(ptr->d_name))>3&& (string(ptr->d_name).rfind(".out",l)==l-4|| string(ptr->d_name).rfind(".ans",l)==l-4)) { rread(n,ptr->d_name+strlen(ptr->d_name)); v.push_back(p(n,string(ptr->d_name))); } realpath(".",s); #else f=f.substr(f.find_last_of('\\',f.length())+1,f.length()); WIN32_FIND_DATA d; HANDLE hFind=FindFirstFile(("..\\..\\data\\"+f+"\\*").c_str(), &d); do if((l=strlen(d.cFileName))>3&& (string(d.cFileName).rfind(".out",l)==l-4|| string(d.cFileName).rfind(".ans",l)==l-4)) { rread(n,d.cFileName+strlen(d.cFileName)); v.push_back(p(n,string(d.cFileName))); } while (FindNextFile(hFind, &d) != 0); FindClose(hFind); GetModuleFileName(NULL,s,1000); #endif rread(n,rread(l,s+strlen(s))); sort(v.begin(),v.end()); #ifdef __linux__ system(("cp -f ../../data/"+f+'/'+v[n].second+" "+f+".out").c_str()); #else system(("copy ..\\..\\data\\"+f+'\\'+v[n].second+" "+f+".out").c_str()); #endif return 0; }

__EOF__

本文作者风丨铃
本文链接https://www.cnblogs.com/-Wind-/p/11841600.html
关于博主:评论和私信会在第一时间回复。或者直接私信我。
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
声援博主:如果您觉得文章对您有帮助,可以点击文章右下角推荐一下。您的鼓励是博主的最大动力!
posted @   风丨铃  阅读(276)  评论(1编辑  收藏  举报
编辑推荐:
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· 25岁的心里话
点击右上角即可分享
微信分享提示