Cod sursa(job #673714)
| Utilizator | Data | 4 februarie 2012 20:21:00 | |
|---|---|---|---|
| Problema | Patrate2 | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.25 kb |
#include<stdio.h>
long i,n;
int main()
{
freopen("patrat2.in","r",stdin);
freopen("patrat2.out","w",stdout);
scanf("%d",&n);
while (n>0)
{
i=1;
while (i*i<=n)
i++;
i--;
n-=i*i;
printf("%d\n",i);
}
}
