Advertisement
Guest User

triangulação de capetay

a guest
Sep 20th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. /*
  4.     Team
  5.         Balão Vermelho
  6. */
  7.    
  8.    
  9. int main (){
  10.    
  11.     double x, I=3;
  12.     int l;    
  13.     scanf("%d", &l);    
  14.    
  15.     while (l!=0){
  16.         if((l%3)!=0){
  17.             I = (3 + (((l-1)/3)-1)*6) + (l%3)*2;
  18.         }else{
  19.             I = 3 + ((l/3)-1)*6;
  20.         }
  21.         x = (I-l)/l;
  22.         printf("%.6lf\n", x);
  23.         scanf("%d", &l);
  24.     }
  25.    
  26.    
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement