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

相关推荐
阿俊-全栈开发1 小时前
LikeShop 单商户SaaS商城分销模块二开:佣金计算与结算逻辑实现
java·开发语言·微服务·likeshop·likeshop开源商城·likeshop多商户
weixin_424183613 小时前
开放—封闭原则实战(下):基于策略的流程编排与编译期多态
c++·分布式·系统架构
wuminyu4 小时前
C++协程实现接收端的零拷贝Buffer管理原理剖析
java·linux·c语言·jvm·c++
m0_380743874 小时前
C++中的freopen的用法实例详解
开发语言·c++
Escalating_xu5 小时前
【Python】基础语法(1):常量、变量、类型、输入输出与运算符
开发语言·python
jimy15 小时前
polymorph.cpp里面的“析构函数、智能指针”问题
开发语言·c++
m0_380743875 小时前
PHP 8.3 缓存清除不生效怎么排查
开发语言·php
朝朝辞暮i5 小时前
C++ 第 6 课:switch —— 多状态选择
开发语言·c++·算法
小凡geo6 小时前
本地商家 GEO:用脚本一键生成 FAQPage 结构化数据,让 AI 切片更稳
开发语言·人工智能·python·microsoft·搜索引擎·ai
朝朝辞暮i6 小时前
C++ 第 4 课:if / else —— 让程序自己做决定
开发语言·c++