Header Ads

Header ADS

Solution of URI 1142::PUM

Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problemyou will inform me by comment.




#include <stdio.h>

int main()
{
    int N,i,j,k=0;

    scanf("%d",&N);

    for(i=1;i<=N;i++) {
            j=k+1;
        for(k=j;k<=j+2;k++) {
            printf("%d ",k);
        }
        printf("PUM\n");
    }
    return 0;
}

No comments

Theme images by konradlew. Powered by Blogger.