Results 1 to 4 of 4
Thread: ++
Hybrid View
-
29th December 2010 02:14 #1
++
- , 6,7,8...- 650819 . 5- . .Code:#include<iostream.h> #include<fstream.h> int nmbs[10]={0,1,2,3,4,5,6,7,8,9}; int array[8]; int var; ofstream file ("passwords.txt"); void Print(int l) { for(int i=0;i<l;i++) file<<array[i]; file<<endl; } int allnine(int l) { int y=0; for(int i=0;i<l;i++) { if(array[i]==9) y=1; else return 0; } return y; } void check(int pos,int l) { if(array[pos-1]==9)check(pos-1,l); else { array[pos-1]++; for(int i=pos;i<l;i++) array[i]=0; } } void change(int pos,int l) { for(int i=0;i<10;i++) { array[pos]=nmbs[i]; Print(l); } if(allnine(l)==1) return; else { check(pos,l); change(pos,l); } } int main() { int l; cout<<"Kolko cifreno 4islo ti trqbva?"<<endl; cin>>l; int pos=(l-1); change(pos,l); system("pause"); return 0; }
-
29th December 2010 02:24 #2
-
29th December 2010 10:39 #3
long? , long. "double array[10]" double, double, ? , . . ?
-
29th December 2010 11:34 #4Registered User
Join Date: Oct:2003
Location:
Posts: 4,317
, , . - . , :
http://en.wikipedia.org/wiki/Tail_call
. , .




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in