c++里面的next_permutation
摘要:使用前1.#include<algorithm> 2.using namespace std; 3.不能直接用数组进行while(next_permuatation(Arr[0],Arr[3]));而要用vector容器 4.在使用vector容器的时候也得进行while(next_permutat
阅读全文
判断一个数的各个数位是否有重复的数字
摘要:思想 利用数组 int Arr[10]={0}; 然后用待判断的数字a 依次对10取余(再除以10) 得到各个数位的数,并且让Arr[a%10]=1; 并且判断是否出现Arr[a%10]==1,如果出现的话则有重复数字。 以下是c语言代码: int RepetitionNum(int a){ int
阅读全文
整数溢出
摘要:int 输出printf(“%d”); -2147483648~2147483647 十位数就有可能出问题溢出 long int 的时候输出printf("ld"); 和int 一样 -2147483648~2147483647 十位数就有可能有问题溢出 long long int 的时候输出pri
阅读全文