URI / BEE CROWD 1098 - Sequence IJ 4 Solution in C,C++,Python | URI - BEECROWD - BEE 1098 Solution in C,C++,Python
beecrowd | 1098
Sequence IJ 4
Adapted by Neilor Tonin, URI Brazil
Timelimit: 1Adapted by Neilor Tonin, URI Brazil
URI / BEE CROWD 1098 - Sequence IJ 4 Solution in C,C++,Python | URI - BEECROWD - BEE 1098 Solution in C,C++,Python:
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 Sample | Output Sample |
I=0 J=1 |
Demonstration:
URI / BEE 1098 Solution in C :
URI / BEECROWD Online Judge 1098 Solve in C : |
#include <stdio.h>
int main(){
float i = 0;
float j = 1;
while(i <= 2.2){
if((i>0 && i<1)|| (i>1 && i<2) || (i>2.1 && i<=2.2) )
{
printf("I=%0.1f J=%0.1f\n",i,j+i);
printf("I=%0.1f J=%0.1f\n",i,j+1+i);
printf("I=%0.1f J=%0.1f\n",i,j+2+i);
}
else
{
printf("I=%d J=%d\n",(int)i,(int)j+(int)i);
printf("I=%d J=%d\n",(int)i,(int)j+1+(int)i);
printf("I=%d J=%d\n",(int)i,(int)j+2+(int)i);
}
i+= 0.2;
}
return 0;
}
0 Response to URI / BEE CROWD 1098 - Sequence IJ 4 Solution in C,C++,Python | URI - BEECROWD - BEE 1098 Solution in C,C++,Python
Post a Comment