Monday, May 30, 2016

URI Online Judge Solution 1095 || Sequence IJ 1

URI Online Judge | 1095

Sequence IJ 1

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Make a program that prints the sequence like the following example.

Input

This problem doesn't have input.

Output

Print the sequence like the example below.
Input SampleOutput Sample
I=1 J=60
I=4 J=55
I=7 J=50
...
I=? J=0


URI Online Judge Solution 1095 || Sequence IJ 1 in JAVA


import java.io.IOException;
public class Main {
 
    public static void main(String[] args) throws IOException {
 
        for (int I = 1, J = 60; J >= 0; I += 3, J -= 5) {
            System.out.print("I=" + I + " J=" + J + "\n");
        }
 
    }
}


URI Online Judge Solution 1095 || Sequence IJ 1 in C

#include<stdio.h>
int main(){
    int I, J;
    for(I = 1, J = 60; J >= 0; I += 3, J -= 5) {
        printf("I=%d J=%d\n", I, J);
    }
    return 0;
}

Dropbox download link
Question link in URI OJ


No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.