Advertisement
dllbridge

Untitled

Feb 4th, 2022
1,570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3.  
  4. int  a,
  5.      b = 1000,
  6.      c,
  7.      d,
  8.      f;
  9.  
  10.  
  11.  
  12. ///////////////////////////////////////////////////////////////////////////
  13. int main()                                                               //
  14. {
  15.  
  16.     printf("Books: ");
  17.     scanf ("%d",  &a);
  18.    
  19.     d = a % 7;
  20.     f = a / 7;
  21.  
  22.     for(int for_a = 0; for_a < f; for_a++)
  23.     {
  24.         for(int for_b = 0, b = 1000; for_b < 7; for_b++, b -= 55)
  25.         {
  26.             c += b;
  27.         }
  28.     }
  29.    
  30.     b = 1000;
  31.  
  32.     for(int for_a = 0; for_a < d; for_a++, b -= 55)
  33.     {
  34.         c += b;
  35.     }
  36.     printf("%d\n", c);
  37.  
  38. return 0;
  39. }
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement