新发现的视觉盛宴

我偶然间发现的视觉盛宴,但是显卡不好的可以练习烤肉(用CPU)。
包括横向拉扯和斜向拉扯代码如下(不要用VScode)

#include <bits/stdc++.h>
using namespace std;
int i;
int main()
{
	while(++i){
		for(int j=1;j*j<=i;j++){
			cout<<" ";
		}
		cout<<"<H>";
	}
	return 0;
}

2 个赞
#include<bits/stdc++.h>
using namespace std;
int a[10000][10000],n;
void dfs(int x,int y,int z)
{
	if(z==0)
	{
		a[x][y]=1;
		return;
	}
	int s=pow(3,z-1);
	dfs(x,y,z-1);
	dfs(s*2+x,y,z-1);
	dfs(s+x,s+y,z-1);
	dfs(x,s*2+y,z-1);
	dfs(s*2+x,s*2+y,z-1);
}
int main()
{
	cin>>n;
	dfs(1,1,n);
	for(int i=1;i<=pow(3,n-1);++i)
	{
		for(int j=1;j<=pow(3,n-1);++j)
		if(a[i][j]==1) cout<<"x";
		else cout<<" ";
		cout<<endl;
	}
	return 0;
}
1 个赞

你想干嘛

1 个赞
#include<bits/stdc++.h>
using namespace std;
char a[5001][5001];
char b[2][5] = {" /\\ ",
                "/__\\"};
int n;
void dfs(int x,int y,int z)
{
	if(z==1)
	{
		for(int i=0;i<2;++i)
		for(int j=0;j<4;++j) a[x+i][y+j]=b[i][j];
		return;
	}
	dfs(x+pow(2,z-2)*2,y,z-1);
    dfs(x,y+pow(2,z-3)*4,z-1);
    dfs(x+pow(2,z-2)*2,y+pow(2,z-2)*4,z-1);
}
int main()
{ 
	cin>>n;
	memset(a,' ',sizeof(a));
	dfs(0,0,n);
	for(int i=0;i<pow(2,n-1)*2;++i)
	{
		for(int j=0;j<pow(2,n-1)*4;++j) cout<<a[i][j];
		cout<<endl;
	}
	return 0;
}
2 个赞

运行一下

2 个赞
#include <bits/stdc++.h>
#include<windows.h>
using namespace std;
int i;
int main()
{
	while(++i){
		for(int j=1;j*j<=i;j++){
			cout<<" ";
		}
		cout<<"<H>";
		if(i%10==0) system("cls");
	}
	return 0;
}
#include <bits/stdc++.h>
#include<windows.h>
using namespace std;
int i;
int main()
{
	while(++i){
		for(int j=1;j*j<=i;j++){
			cout<<"                                       <H>";
		}
		if(i%10==0) system("cls");
	}
	return 0;
}
#include <bits/stdc++.h>
#include<windows.h>
using namespace std;
int i;
int main()
{
	while(++i){
		for(int j=1;j*j<=i;j++){
			cout<<"                                       <H>";
		}
		system("cls");
	}
	return 0;
}
#include <bits/stdc++.h>
#include<windows.h>
using namespace std;
int i;
int main()
{
	while(++i){
		for(int j=1;j*j<=i;j++){
			cout<<" ";
		}
		cout<<"<H>";
		if(i%100==0) system("cls");
	}
	return 0;
}

这些也是视觉盛宴

2 个赞

#include <bits/stdc++.h>
using namespace std;
int i;
int main() {
while(++i) {
for(int j=1; j*j<=i; j++) {
srand(j);
for(int k=1; k<=rand()%100; k++) {
cout<<" ";
}

		cout<<"-=+#+=-";
	}
}
return 0;

}

1 个赞

你这随机数有点不是纯随机

1 个赞
#include <bits/stdc++.h>
using namespace std;
int i;
int main() {
while(++i) {
for(int j=1; j*j<=i; j++) {
srand(time(NULL));
for(int k=1; k<=rand()%100; k++) {
cout<<" ";
}

		cout<<"-=+#+=-";
	}
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int i;
int main() {
while(++i) {
for(int j=1; j*j<=i; j++) {
srand(time(NULL));
for(int k=1; k<=rand()%10000; k++) {
cout<<" ";
}

		cout<<"-=+#+=-";
	}
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int i;
int main()
{
	srand(time(NULL));
	while(++i){
		for(int j=1;j*j<=rand()%1000;j++){
			cout<<" ";
		}
		cout<<"<H>";
	}
	return 0;
}

这才叫视觉盛宴

1 个赞