Mai intai trebuie sa te autentifici.
Cod sursa(job #612941)
Utilizator | Data | 13 septembrie 2011 18:31:47 | |
---|---|---|---|
Problema | Jocul Flip | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <cstdio>
#include <algorithm>
using namespace std;
int n,i,ok,v[100],j;
int main()
{
freopen("flip.in","r",stdin);
freopen("flip.out","w",stdout);
scanf("%d %d",&n,&m);
ok=1;
while(ok==1)
{
i=n;
while(v[i]==1&&i>=1)
i--;
if(i<1)
ok=0;
else
{
v[i]=1;
for(j=i+1;j<=n;j++)
v[j]=0;
for(i=1;i<=n;i++)
printf("%d ",v[i]);
printf("\n");
}
}
return 0;
}