当前位置:网站首页>Full arrangement of numbers (digital password dictionary)
Full arrangement of numbers (digital password dictionary)
2022-06-12 09:08:00 【Record dada I】
Digital password dictionary
Number selection space :0-9
do n A complete arrangement of digits
Console output :
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int num=1;
for(int i =1; i<n; i++) {
num=num*10;// Calculate the start bit
}
int sum=num*10-1;// Calculation end bit
for(int i =0; i<=sum; i++) {
cout<<setw(n)<<setfill('0')<<i<<endl;// common n position , The front is not enough to fill zero , single quote
}
return 0;
}
Write it to the file :
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int num=1;
ofstream write;// Define variables written to the file
write.open("password.txt");// Indicates that you want to output the content to “password.txt" In this document If you don't have this file , This file will be created automatically
for(int i =1; i<n; i++) {
num=num*10;// Calculate the start bit
}
int sum=num*10-1;// Calculation end bit
int j=0;
for(int i =0; i<=sum; i++) {
write<<setw(n)<<setfill('0')<<i<<endl;// common n position , The front is not enough to fill zero , single quote
j++;// Count the number of generated passwords
}
write.close();// Close input stream
cout<<" Output complete , Generate password altogether :"<<j;
return 0;
}
边栏推荐
- 43 cas d'analyse du réseau neuronal MATLAB: chapitre 7 régression du réseau RBF - - réalisation de la régression fonctionnelle non linéaire
- IDEA新版UI申请方法+无测试资格使用方法及相关介绍
- MFS详解(四)——MFS管理服务器安装与配置
- 【字符集八】char8_t、char16_t、char32_t、wchar、char
- Description of string
- Jupyter notebook sets the default browser to open with an error syntaxerror: (Unicode error) 'UTF-8' codec can't decode byte 0xd4
- 解压缩zip文件的工具类
- (十五) TweenRunner
- (十二)交互组件Selectable
- Background attribute compound writing
猜你喜欢

Composition of box model

2022 low voltage electrician retraining question bank and online simulation examination

通俗理解时域采样与频域延拓

ERROR 1630 (42000): FUNCTION a.avg does not exist. Check the ‘Function Name Parsing and Resolution‘

Unittest测试框架

第八章-数据处理的两个基本问题

Flink CheckPoint : Exceeded checkpoint tolerable failure threshold

Definition of polar angle and its code implementation

Chapter 8 - two basic problems of data processing

最少换乘次数
随机推荐
【无标题】Task3 多路召回
Jenkins Pipeline 语法
清华大学数据挖掘笔记(一)
Introduction to applet cloud development -- questionnaire evaluation applet practice (7)
Does database and table splitting cause reading diffusion problems? How to solve it?
Analysis of 43 cases of MATLAB neural network: Chapter 8 prediction of GRNN Network - Freight Volume Prediction Based on generalized regression neural network
ip、DNS、域名、URL、hosts
Binary tree calculation problem
域名映射到指定IP
Several ways to restart kubernetes pod
第三章 寄存器 (内存访问)
ERROR 1630 (42000): FUNCTION a.avg does not exist. Check the ‘Function Name Parsing and Resolution‘
MySQL - Import / export operation
[character set 8] char8_ t、char16_ t、char32_ t、wchar、char
Sword finger offer:[day 8 dynamic planning (simple)] --- > frog jumping on steps
第六章-包含多个段的程序
Analysis of 43 cases of MATLAB neural network: Chapter 7 regression of RBF Network -- Realization of nonlinear function regression
(node:22344) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permit
Leetcode689 wrong greedy thinking
剑指 Offer II 016. 不含重复字符的最长子字符串-滑动窗口