Advertisement
FoxTuGa

Cord X.Y - <Old>

May 8th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. double x, y;
  5.  
  6.  
  7. int main()
  8. {
  9.     printf("                                                          Leandro Soares");
  10.  
  11.     printf("\n x : ");
  12.     scanf("%lf", &x);
  13.  
  14.     printf("\n y : ");
  15.     scanf("%lf", &y);
  16.  
  17.     if( x == 0 )
  18.     {
  19.         if( y == 0)
  20.         {
  21.             printf("\n\n o ponto esta na origem \n\n\n\n");
  22.             return 0;
  23.         }  
  24.             if( y > 0 )
  25.             {
  26.                 printf("\n\n o ponto esta no eixo y positivo \n\n\n\n");
  27.                 return 0;
  28.             }
  29.                 if( y < 0 )
  30.                 {
  31.                     printf("\n\n o ponto esta no eixo y negativo \n\n\n\n");
  32.                     return 0;
  33.                 }
  34.     }      
  35.  
  36.     if( y == 0 )
  37.     {
  38.         if( x == 0 )
  39.         {
  40.             printf("\n\n o ponto esta na origem \n\n\n\n");
  41.             return 0;
  42.         }
  43.             if( x > 0 )
  44.             {
  45.                 printf("\n\n o ponto esta no eixo x positivo \n\n\n\n");
  46.                 return 0;
  47.             }
  48.                 if( x < 0 )
  49.                 {
  50.                     printf("\n\n o eixo esta no eixo x negativo \n\n\n\n");
  51.                     return 0;
  52.                 }
  53.     }
  54.     if( y > 0 )
  55.     {
  56.         if( x > 0 )
  57.         {  
  58.             printf("\n o ponto e positivo e esta no primeiro quandrante \n\n\n\n");
  59.             return 0;
  60.         }
  61.             if( x < 0 )
  62.             {
  63.                 printf("\n o ponto e negativo e esta no quarto quadrante \n\n\n\n");
  64.                 return 0;
  65.             }
  66.     }
  67.    
  68.     if( y < 0 )
  69.     {
  70.         if( x > 0 )
  71.         {
  72.             printf("\n o ponto e negativo e esta no segundo quadrante \n\n\n\n");
  73.             return 0;
  74.         }
  75.             if( x < 0)
  76.             {
  77.                 printf("\n o ponto e negativo esta no terceiro quadrante \n\n\n\n");
  78.                 return 0;
  79.             }
  80.     }
  81.  
  82.  
  83.     return 0;
  84.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement