uri problem 1046

Solutions on MaxInterview for uri problem 1046 by the best coders in the world

showing results for - "uri problem 1046"
Michela
08 Feb 2016
1// URI PROBLEM : 1046 || GAME TIME
2#include <stdio.h>
3int main()
4{
5  int s, e, time;
6
7  scanf("%d %d", &s, &e);
8  if (e <= s)
9  {
10    e = e + 24;
11  }
12  time = e - s;
13  printf("O JOGO DUROU %d HORA(S)\n", time);
14  return 0;
15}
Nicki
03 Jun 2020
1// URI Problem : 1045 || Trangle Types
2#include <stdio.h>
3int main()
4{
5  double a, b, c, temp, x, y, z;
6  scanf("%lf %lf %lf", &a, &b, &c);
7  x = a;
8  y = b;
9  z = c;
10  if (a < b)
11  {
12    temp = a;
13    a = b;
14    b = temp;
15  }
16  if (a < c)
17  {
18    temp = a;
19    a = c;
20    c = temp;
21  }
22  if (b < c)
23  {
24    temp = b;
25    b = c;
26    c = temp;
27  }
28
29  if (a >= b + c)
30  {
31    printf("NAO FORMA TRIANGULO\n");
32  }
33  else
34  {
35
36    if ((a * a) == (b * b) + (c * c))
37    {
38      printf("TRIANGULO RETANGULO\n");
39    }
40    if ((a * a) > (b * b) + (c * c))
41    {
42      printf("TRIANGULO OBTUSANGULO\n");
43    }
44    if ((a * a) < (b * b) + (c * c))
45    {
46      printf("TRIANGULO ACUTANGULO\n");
47    }
48    if (a == b && a == c && b == c)
49    {
50      printf("TRIANGULO EQUILATERO\n");
51    }
52    if ((a == b && a != c) || (a == c & a != b) || (b == c && b != a))
53    {
54      printf("TRIANGULO ISOSCELES\n");
55    }
56  }
57
58  return 0;
59}