丢个配置。。
编译
#!/bin/sh
fullname=$GEDIT_CURRENT_DOCUMENT_NAME
name=`echo $fullname | cut -d. -f1`
g++ -o $name $fullname -DIN
运行
#!/bin/sh
fullname=$GEDIT_CURRENT_DOCUMENT_NAME
name=`echo $fullname | cut -d. -f1`
dir=$GEDIT_CURRENT_DOCUMENT_DIR
gnome-terminal -x bash -c "$dir/$name; echo;echo 'Nobody knows delicious food better than Zhy';read"
代码补全
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define R register
#define LL long long
const int inf=0x3f3f3f3f;
const int MAXN=;
inline int read() {
char a=getchar(); int x=0,f=1;
for(;a>'9'||a<'0';a=getchar()) if(a=='-') f=-1;
for(;a>='0'&&a<='9';a=getchar()) x=x*10+a-'0';
return x*f;
}
int main() {
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
return 0;
}
造数据
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <ctime>
using namespace std;
#define R register
#define LL long long
inline void printarr(int n) {
int mod=10;
for(R int i=1;i<=n;i++) printf("%d%c",rand()%mod,i==n?'
':' ');
}
inline void printseg(int n) {
int l=rand()%n+1,r=rand()%n+1;
if(l>r) swap(l,r);
printf("%d %d
",l,r);
}
inline void printree(int n) {
for(R int i=2;i<=n;i++) {
printf("%d %d
",i,rand()%(i-1)+1);
}
}
int main() {
srand(time(0));
freopen("a.in","w",stdout);
//freopen(".out","w",stdout);
int n=10,m=10;
return 0;
}
对拍
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define R register
int main() {
system("g++ -o a a.cpp");
system("g++ -o b b.cpp");
system("g++ -o m m.cpp");
int tot=0;
while(1) {
system("./m");
system("./a");
system("./b");
if(system("diff a.out b.out")) break;
else printf("Case:%d Accept!
",++tot);
}
return 0;
}