1097 Sequence IJ 3

SemiColon
By -
0
URI Online Judge | 1097

Sequence IJ 3

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


Solution:
#include <stdio.h>
int main()
{
    int I,J,a=7,b;
    for(I=1;I<=9;I=I+2)
    {
        for(b=1,J=a;b<=3;J--,b++)
            printf("I=%d J=%d\n", I, J);
        a=a+2;
    }
    return 0;
}
Tags:

Post a Comment

0Comments

Post a Comment (0)