汉字古诗生成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

相关推荐
zoujiahui_20184 分钟前
Python 包与环境管理工具 uv
开发语言·python·uv
吴声子夜歌17 分钟前
Java面试题——JVM(二)
java·开发语言·jvm
CRMEB19 分钟前
商城大促活动策划全流程:从定目标到复盘四阶段
java·开发语言·人工智能·ai·开源·php
denglinqings20 分钟前
Java开发从入门到精通所有课程
java·开发语言
程序猿阿森44 分钟前
Python 闭包与装饰器:从入门到精通
开发语言·python·面试
余额瞒着我当琳1 小时前
C++--vector底层,leetcode118杨辉三角实战,对于传统reserve的坑点,迭代器失效
开发语言·c++
曹牧1 小时前
C#:字符串做20位截断
开发语言·c#
醉城夜风~1 小时前
(超详细)C++多态(Polymorphism)
开发语言·c++
这是个栗子1 小时前
【JS代码分析】前端鉴权基础:Token 的本地存储与状态重置实践
开发语言·前端·javascript
wuyk5552 小时前
7.AVL 树:第一个自平衡二叉搜索树
开发语言·stm32·单片机·算法