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

相关推荐
我命由我123456 分钟前
Kotlin 开发 - lateinit 关键字
android·java·开发语言·kotlin·android studio·android-studio·android runtime
智者知已应修善业8 分钟前
【51单片机2个按键控制流水灯运行与暂停】2023-9-6
c++·经验分享·笔记·算法·51单片机
Halo_tjn10 分钟前
Java Set集合相关知识点
java·开发语言·算法
许彰午29 分钟前
我手写了一个 Java 内存数据库(二):B+ 树的插入与分裂
java·开发语言·面试
大飞记Python44 分钟前
【2026更新】Python基础学习指南(AI版)——04数据类型
开发语言·人工智能·python
Alice-YUE1 小时前
【js高频八股】防抖与节流
开发语言·前端·javascript·笔记·学习·ecmascript
云泽8081 小时前
C++11 核心特性全解:列表初始化、右值引用与移动语义实战
开发语言·c++
froginwe112 小时前
DOM 加载函数
开发语言
Hello eveybody2 小时前
介绍一下背包DP(Python)
开发语言·python·动态规划·dp·背包dp
AI进化营-智能译站2 小时前
ROS2 C++开发系列12-用多态与虚函数构建可扩展的ROS2机器人行为模块
开发语言·c++·ai·机器人