zoukankan      html  css  js  c++  java
  • ubuntu下c++ Gedit配置

    丢个配置。。 

    编译

    #!/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;	
    }
    
  • 相关阅读:
    线程之Thread
    如何通过HTTP优雅调用第三方-Feign
    Spring AOP核心源码
    Spring-beans之BeanFactory初始化
    spring-core源码走读
    power of two
    排序算法(二)两种选择排序
    排序算法(一)四种冒泡排序
    约瑟夫问题
    我理解的CLH
  • 原文地址:https://www.cnblogs.com/clover4/p/12848889.html
Copyright © 2011-2022 走看看