Sunday, March 20, 2016

URI 1146 - Growing Sequences

#include<stdio.h>
main()
{
    int x , i;
    while(scanf("%d",&x)==1){
            if(x==0)
            break;
            else{
                for(i=1; i<x; i++){
                    printf("%d ",i);
                }
                printf("%d\n",x);
    }
    }
}

No comments:

Post a Comment