Advertisement
villers

Untitled

Oct 2nd, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.19 KB | None | 0 0
  1. /*
  2. ** my_aff_comb2.c for J03_my_aff_comb2 in /home/viller_m/rendu/Piscine_C_J03
  3. **
  4. ** Made by mickael villers
  5. ** Login   <[email protected]>
  6. **
  7. ** Started on  Wed Oct  1 11:41:10 2014 mickael villers
  8. ** Last update Wed Oct  1 14:16:52 2014 mickael villers
  9. */
  10.  
  11. void  my_aff_number(char nb1, char nb2, char nb3, char nb4, int type)
  12. {
  13.   if (type == 1)
  14.     {
  15.       my_putchar(',');
  16.       my_putchar(' ');
  17.     }
  18.   my_putchar(nb1);
  19.   my_putchar(nb2);
  20.   my_putchar(' ');
  21.   my_putchar(nb3);
  22.   my_putchar(nb4);
  23. }
  24.  
  25. void  my_loop(char nb1, char nb2, char nb3, char nb4)
  26. {
  27.   while (nb1 != '9' || nb2 != '8')
  28.     {
  29.       nb4 = nb4 + 1;
  30.       if (nb4 > '9')
  31.         {
  32.           nb4 = '0';
  33.           nb3 = nb3 + 1;
  34.           if (nb3 > '9')
  35.             {
  36.               nb3 = '0';
  37.               nb2 = nb2 + 1;
  38.               if (nb2 > '9')
  39.                 {
  40.                   nb2 = '0';
  41.                   nb1 = nb1 + 1;
  42.                 }
  43.               nb4 = nb2 + 1;
  44.               nb3 = nb1;
  45.             }
  46.         }
  47.       my_aff_number(nb1, nb2, nb3, nb4, 1);
  48.     }
  49. }
  50.  
  51. int my_aff_comb2()
  52. {
  53.   my_aff_number('0', '0', '0', '1', 0);
  54.   my_loop('0', '0', '0', '1');
  55.   return (0);
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement