生成从 1 到 1000 的卡拉奇特系列的程序,其中包括数字和字母
Program that generates a serie of carachtere from 1 to 1000 that includes numbers and letters
我想创建一个程序,生成从 1 到 1000 的卡拉奇特雷系列,其中包括数字和字母。例如:0001 0002 0003 0004 0005 0006 0007 0008 0009 000a 000b 000c 000d 000e 000f ...000Z 0010 00011 ...
只需将您的数字放在一个字符串中并循环播放它们
#include <string>
#include <iostream>
const std::string digits = "0123456789abcdefghijklmnopqrstuvwxyz";
int main()
{
for (auto a : digits)
{
for (auto b : digits)
{
for (auto c : digits)
{
for (auto d : digits)
{
std::cout << a << b << c << d << 'n';
if (a == '1') // stop at 1000
return 0;
}
}
}
}
}
四位数,四环。将您喜欢的任何字母或数字放入数字中。如果需要,请添加停止条件。
有更复杂的方法可以做到这一点,但以上应该适合你。
相关文章:
- 我写了一个简单的矢量程序,在其中我得到了以下输出。你能帮我理解它的输出吗?
- 无法在C++程序中包括 gstreamer
- 如果我对"while"块发表评论,为什么程序会死机?其中的"yield"线有何影响?
- 如何制作一个结构程序,在其中可以存储无限量的数据,以便每次您想要时都可以将另一个产品添加到列表中?
- 程序在其中一个案例完成后终止,但对于其他情况则不终止
- 有没有办法从程序中打开一个新控制台,然后进入其中
- 使用 A 类,其中包括 B 类中的 B 类
- 程序以计数5位数字的数量可排除3,而其中没有6,7,8和9
- 我正在做一个有空隙的程序。其中一个不会出现吗?
- 如何在C++应用程序中包括外部PCH文件
- 在程序中包括大量文本文件C++
- 专用模板,其中包括启用
- 生成从 1 到 1000 的卡拉奇特系列的程序,其中包括数字和字母
- 在Linux下的C 程序中包括AMP.H LIB
- 我在哪里可以找到arm-linux-gneabihf-ld的手册页,更不用说写得很好的手册页了,其中包括-rpath和-
- 在C++的应用程序中包括文件(dll,txt等.exe
- 我的VS2013应用程序应该包括哪个C++合并模块
- 在应用程序中包括正确的C++编辑
- 在.NET应用程序中包括NOT.NET cpp和h
- 在QT4应用程序中包括静态外部库