URI Online Judge | 1098
Sequencia IJ 4
Adaptado por Neilor Tonin, URI
Brasil
Timelimit: 1
Você deve fazer um programa que apresente a sequencia conforme o exemplo abaixo.
Entrada
Não há nenhuma entrada neste problema.
Saída
Imprima a sequencia conforme exemplo abaixo.
URI Online Judge | 1098
Sequence IJ 4
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.
#include<stdio.h>
int main()
{
float i, j, valor;
int temp, temp2;
for (i = 0, j = 1, valor = 0, temp = 0, temp2 = 0; i < 2.2; j++)
{
if(temp2 == 0){
printf("I=%.0f J=%.0f\n", i, j);
}else{
printf("I=%.1f J=%.1f\n", i, j);
}
temp++;
if(temp == 3){
i += 0.2;
valor += 0.2;
j = valor;
temp = 0;
temp2++;
}
if(temp2 == 5)
temp2 = 0;
}
return 0;
}
Nenhum comentário:
Postar um comentário