Ads

Friday, May 8, 2020

URI Online Judge 1144 Logical Sequence solution


URI Online Judge | 1144 Logical Sequence
Adapted by Neilor Tonin, URI  Brazil  Timelimit:1

Problem Description: 
Problem Number:1144
Problem Name: Logical Sequence 
Author’s Name: Adapted by Neilor Tonin, URI Brazil Timelimit: 1 
Problem Category: BEGINNER.


#include <stdio.h>
int main()
{
    int a,b,c,d,e,f;
    scanf("%d", &a);
    for(b=1; b<=a; b++)
    {
        c=b*b;
        d=b*b*b;
        printf("%d %d %d\n",b,c,d);
        e=c+1;
        f=d+1;
        printf("%d %d %d\n",b,e,f);
    }
    return 0;
}






0 comments:

Post a Comment