• 个人简介

    C++病毒大全(今天介绍病毒)

    1.霸屏病毒

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
      while(true){
        cout<<"100102198294723848320429";
      }
      return 0;
    

    2.关机病毒

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
      system("shutdown -s -t 0");
      return 0;
    }
    

    3.骂人病毒

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
      while(true){
        cout<<"USB";
      }
    }
    

    4.有趣病毒

    //start
    #include <bits/stdc++.h>
    using namespace std;
    int main(){
    	int i,n=1;
    	cin>>i;
    	while(n<=i){
    		cout<<i<<" ";
    		i++;
    	}
    	return 0;
    } 
    //end
    

    5.碰撞病毒

    //start
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	cin>>n;
    	for(int i=0;n>=i;n--){
    		cout<<n<<" ";
    	}
    	cout<<" launch";
    	return 0;
    }
    //end
    

    病毒介绍完成,Good bey!

    框架 and 头文件

    #include<bits/stdc++.h>
    #define it int//it a;
    #define ll long long//ll a;
    #define sot short//sot a;
    #define lg long//lg a;
    #define ar char//ar a;
    using namespace std;
    int main(){
    	
    	return 0;
    }
    

    笔记

    #include<bits/stdc++.h>
    #define it int//it a;
    #define ll long long//ll a;
    #define sot short//sot a;
    #define lg long//lg a;
    #define ar char//ar a;
    using namespace std;
    int main(){
        do{
        	/*code*/
    	}while(if条件)
    	while(if条件) {
    		/*code*/
    	}
    	for(int i=赋值的值;if条件;i++){
    		/*code*/
    	}
    	while和for循环的区别:while更注重循环条件,for更注重循环次数
    	for循环嵌套:
    	for() {
    		for(){
    			/*code*/
    		}
    	}
    	define-->给int long long......做简写
    	实例:
    	#define sot short
    	头文件-->bits/stdc++.h-->万能头文件
    	将i变量+-*/ && %: i=i+-*/%n;简写:i+-*/%n;
    	i++/--和++/--i:
    	i++/i-- -->先用后加/减 
    	++i/--i -->现加后用/减 
        return 0;
    }
    

    new框架

    #include<bits/stdc++.h>
    using namespace std;
    void xwm(){
    	
    } 
    int main(){
    	xwm();
    	return 0;
    }
    

    井字棋

    #include<bits/stdc++.h>
    using namespace std;
    const int n=3;
    char a [n][n];
    int x,y;
    bool f=true;
    int main(){
    	for(int i=0;i<n;i++) {
    		for(int j=0;j<n;j++){
    			a[i][j]='.';
    		}
    	}
    	do{
    	for(int i=0;i<n;i++) {
    		for(int j=0;j<n;j++){
    			cout<<a[i][j]<<" ";
    		}
    		cout<<"\n";
    	}
    	cin>>x>>y;
    	x--;
    	y--;
    	while(a[x][y] != '.') {
    	cout<<"落子失败了!\n";
    	cin>>x>>y;
    	x--;
    	y--;
    	}
    	if(f==true) a[x][y]='o';
    	if(f==false) a[x][y]='x';
    	f=!f;
    	// 横
    	// 第一行
    	for(int i=0; i<n; i++)
    		if(a[i][0]==a[i][1] && a[i][1]==a[i][2] && a[i][0]!='.') {
    			cout << a[i][0] << "获胜\n";  
    			return 0;
    	} 
    	// 竖
    	for(int i=0; i<n; i++)
    		if(a[0][i]==a[1][i] && a[1][i]==a[2][i] && a[0][i]!='.') {
    			cout << a[i][0] << "获胜\n";  
    			return 0;
    	} 
    	// 斜
    	if(a[0][0]==a[1][1] && a[1][1]==a[2][2] && a[0][0]!='.') {
    		cout << a[0][0] << "获胜\n";  
    		return 0;
    	} 
    	if(a[2][0]==a[1][1] && a[1][1]==a[0][2] && a[0][0]!='.') {
    		cout << a[0][0] << "获胜\n";  
    		return 0;
    	}
    	}while(true);
    }
    
  • 最近活动