汉字古诗生成c++

直接上代码!!!!!!

cpp 复制代码
#include <iostream>
#include <ctime>
#include <Windows.h>
using namespace std;
int main()
{
	BYTE byte3,byte4,byte5;
	int i;
	srand(time(NULL));
	int rand1 = 0xf7 - 0xb0;
	int rand2 = 0xfe - 0xa1;
	string str,str2;
	int rand3 = 0xf7 - 0xa1;
	int rand4 = 0xfe - 0xb0;
	int rand5 = 0xf3 - 0xa2;
	byte3=rand()%rand3+0xb2;
	byte4=rand()%rand4+0xa7;
	byte5=rand()%rand5+0xb1;
	str2=byte3;
	str2+=byte4;
	str2+=byte5;
	cout<<"          "<<str2<<endl;
	BYTE byte1,byte2;
	int r=rand()%5+1;
	if(r==1){
		cout<<"      [唐]";
	}
	if(r==2){
		cout<<"      [宋]";
	}
	if(r==3){
		cout<<"      [元]";
	}
	if(r==4){
		cout<<"      [明]";
	}
	if(r==5){
		cout<<"      [清]";
	}
	int r1=rand()%5+1;
	if(r1==1){
		cout<<"吴小黑AI";
	} 
	if(r1==2){
		cout<<"妈咪大师";
	} 
	if(r1==3){
		cout<<"小狗天才";
	} 
	if(r1==4){
		cout<<"智慧李白";
	} 
	if(r1==5){
		cout<<"王安石AI";
	} 
	cout<<endl; 
	for(int g=1;g<=8;g++){
		for(i=1;i<=5;i++){
		byte1=rand()%rand1+0xb0;
		byte2=rand()%rand2+0xa1;
		str=byte1;
		str+=byte2;
		cout<<str; 
	}
	if(g%2==0){
			cout<<"。"<<endl;
		}else{
			cout<<",";
		}
	}
	return 0;
}

QWQ完QWQ

相关推荐
无限进步_18 分钟前
【C++】只出现一次的数字 II:位运算的三种解法深度解析
数据结构·c++·ide·windows·git·算法·leetcode
网域小星球21 分钟前
C 语言从 0 入门(十七)|结构体指针 + 动态内存 + 文件综合实战
c语言·开发语言·文件操作·结构体指针·动态内存·综合项目
aq553560027 分钟前
三大编程语言深度对比:C# vs 易语言 vs 汇编
开发语言·汇编·c#
小贾要学习29 分钟前
【Linux】TCP网络通信编程
linux·服务器·网络·c++·网络协议·tcp/ip
独特的螺狮粉30 分钟前
云隙一言:鸿蒙Flutter框架 实现的随机名言应用
开发语言·flutter·华为·架构·开源·harmonyos
光泽雨33 分钟前
c# 文件编译的过程
开发语言·c#
赤水无泪1 小时前
09 C++ 11 新增的标准
开发语言
格林威1 小时前
工业相机 SDK 在 Docker 容器中的部署与权限配置(含 USB/GigE)
开发语言·人工智能·数码相机·计算机视觉·docker·容器·工业相机
哎嗨人生公众号1 小时前
手写求导公式,让轨迹优化性能飞升,150ms变成9ms
开发语言·c++·算法·机器人·自动驾驶
code_whiter1 小时前
C++6(模板)
开发语言·c++