URI / BEE CROWD 1097 - Sequence IJ 3 Solution in C,C++,Python | URI - BEECROWD - BEE 1097 Solution in C,C++,Python

URI / BEE CROWD 1097 - Sequence IJ 3 Solution in C,C++,Python | URI - BEECROWD - BEE 1097 Solution in C,C++,Python

                                                                                            beecrowd | 1097

Sequence IJ 3

Adapted by Neilor Tonin, URI  Brazil

                                                                                             Timelimit: 1


URI / BEE CROWD 1097 - Sequence IJ 3 Solution in C,C++,Python | URI - BEECROWD - BEE 1097 Solution in C,C++,Python :


Make a program that prints the sequence like the following exemple.

Input

This problem doesn't have input.

Output

Print the sequence like the example below.

Input SampleOutput Sample

I=1 J=7
I=1 J=6
I=1 J=5
I=3 J=9
I=3 J=8
I=3 J=7
...
I=9 J=15
I=9 J=14
I=9 J=13

                                                          Demonstration:

This program does not take user inputs . Then check the conditions for each test case contains two integer number i and j .Then calculating the sequence by using conditional loop.

Start with i =1 and j =6+i  to i=9 and j=3+i . For every iteration, increment i by 2 and decrement j by 1.
Finally print the result.

N.B: Don't copy paste the code as same. Just try to understand it and try yourself.

  URI / BEE 1097 Solution in C :   

  URI / BEECROWD Online Judge 1097 Solve  in C :                                          

#include <stdio.h>

int main()
{
    int I,J;
    for(I=1;I<=9;I=I+2)
    {
        for(J=6+I;J>3+I;J--)
            printf ("I=%d J=%d\n",I,J);
    }
    return 0;
}

0 Response to URI / BEE CROWD 1097 - Sequence IJ 3 Solution in C,C++,Python | URI - BEECROWD - BEE 1097 Solution in C,C++,Python

Post a Comment