Skip to main content

Posts

Showing posts from October, 2016

URI Online Judge problem 1044 solved

URI Online Judge | 1044 Multiples Adapted by Neilor Tonin, URI   Brazil Timelimit: 1 Read two nteger values (A and B). After, the program should print the message  "Sao Multiplos"  (are multiples) or  "Nao sao Multiplos"  (aren’t multiples), corresponding to the read values. Input The input has two integer numbers. Output Print the relative message to the input as stated above. Input Sample Output Sample 6 24 Sao Multiplos 6 25 Nao sao Multiplos / sagorcseblog.blogspot.com // email:sagor.cse.just@gmail.com #include<stdio.h> int main() {     int a,b,temp;     scanf("%d%d",&a,&b);     if(b>a)     {         temp = b;         b=a;         a=temp;     }     if(a%b==0)         printf("Sao Multiplos\n");     else   ...

URI Online Judge problem 1045 solved

URI Online Judge | 1045 Triangle Types Adapted by Neilor Tonin, URI   Brazil Timelimit: 1 Read 3 double numbers (A, B and C) representing the sides of a triangle and arrange them in decreasing order, so that the side A is the biggest of the three sides. Next, determine the type of triangle that they can make, based on the following cases always writing an appropriate message: if A ≥ B + C, write the message:  NAO FORMA TRIANGULO if A 2  = B 2  + C 2 , write the message:  TRIANGULO RETANGULO if A 2  > B 2  + C 2 , write the message:  TRIANGULO OBTUSANGULO if A 2  < B 2  + C 2 , write the message:  TRIANGULO ACUTANGULO if the three sides are the same size, write the message:  TRIANGULO EQUILATERO if only two sides are the same and the third one is different, write the message:  TRIANGULO ISOSCELES Input The input contains three double numbers, A (0 < A) , B (0 < B) and C (0 < C). ...

URI onlinejudeg problem 1041 solved

Coordinates of a Point Adapted by Neilor Tonin, URI   Brazil Timelimit: 1 Write an algorithm that reads two floating values (x and y), which should represent the coordinates of a point in a plane. Next, determine which quadrant the point belongs, or if you are over one of the Cartesian axes or the origin (x = y = 0). If the point is at the origin, write the message "Origem". If the point is over X axis write "Eixo X", else if the point is over Y axis write "Eixo Y". Input The input contains the coordinates of a point. Output The output should display the quadrant in which the point is. Input Sample Output Sample 4.5 -2.2 Q4 0.1 0.1 Q1 0.0 0.0 Origem // sagorcseblog.blogspot.com // email:sagor.cse.just@gmail.com #include<stdio.h> int main() {     float x,y;     scanf("%f%f",&x,&y);     if(x==0 && y==0)         printf("Origem\n");     ...