Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main(){
- long long cifriNaSegNomer[10];//shte polzvam masiva naobratno
- //index 0 e za edinicite, 1 za deseticite
- long long uspeshnoNomerirani=0,obshtoZaNomerirane,il,ic;
- long long lipsvashti[3],kolkoOvceVzimatSegNomer,broiLipsvashti;
- cin>>obshtoZaNomerirane>>broiLipsvashti;
- lipsvashti[0]=-1;
- lipsvashti[1]=-1;
- lipsvashti[2]=-1;
- for(il=0;il<broiLipsvashti;il=il+1){
- cin>>lipsvashti[il];
- }
- cifriNaSegNomer[0]=1;
- for(ic=1;ic<10;ic=ic+1){
- cifriNaSegNomer[ic]=0;
- }
- while(uspeshnoNomerirani<obshtoZaNomerirane){
- kolkoOvceVzimatSegNomer=1;
- for(ic=0;ic<10;ic=ic+1){
- if(cifriNaSegNomer[ic]==lipsvashti[0] ||
- cifriNaSegNomer[ic]==lipsvashti[1] ||
- cifriNaSegNomer[ic]==lipsvashti[2]){
- kolkoOvceVzimatSegNomer=0;
- }
- }
- uspeshnoNomerirani=kolkoOvceVzimatSegNomer+uspeshnoNomerirani;
- cifriNaSegNomer[0]=1+cifriNaSegNomer[0];
- for(ic=0;cifriNaSegNomer[ic]==10;ic=ic+1){
- cifriNaSegNomer[ic]=0;
- cifriNaSegNomer[ic+1]=1+cifriNaSegNomer[ic+1];
- }
- }
- for(ic=0;ic<10;ic=ic+1){
- cout<<cifriNaSegNomer[ic];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement