Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. public static String dessinerLigneCentree(int lgTotale, int lgLigne){
  2.         String ligne = "";
  3.        
  4.         int demi = (lgTotale/2)+(lgLigne/2);
  5.        
  6.         if(lgLigne%2 == 0)
  7.             demi-=1;
  8.        
  9.         for(int i=0; i<(lgTotale/2)-(lgLigne/2); i++)
  10.             ligne += ' ';
  11.         for(int i = (lgTotale/2)-(lgLigne/2); i<=demi;i++){
  12.             ligne += '|';
  13.         }
  14.        
  15.         return ligne;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement