#include<iostream> #include<string> using namespace std; char ch[5]; void f(int k) { if(k==5){ for(int j=0;j<=4;j++) { cout<<ch[j]; } cout<<endl; return ; } int i; for(i=0;i<=1;i++) { ch[k]=i+‘0‘; f(k+1); } } int main () { f(0); return 0; }
5个for
标签:str pos turn ++ cout main for string i++
#include<iostream> #include<string> using namespace std; char ch[5]; void f(int k) { if(k==5){ for(int j=0;j<=4;j++) { cout<<ch[j]; } cout<<endl; return ; } int i; for(i=0;i<=1;i++) { ch[k]=i+‘0‘; f(k+1); } } int main () { f(0); return 0; }
5个for
标签:str pos turn ++ cout main for string i++
原文地址:https://www.cnblogs.com/zhangshuyao/p/8483040.html