Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int a,
- part,
- start = 1000,
- summa = 0,
- sum = 0,
- full;
- ////////////////////////////////////////////////////////////////////
- int main() //
- {
- printf("Enter count of books: ");
- scanf ("%d", &a);
- part = a % 7; // остаток книг < 7
- full = a / 7; // полных серий книг по 7 шт.
- for(int i = 1; i <= 7; i++)
- {
- summa += start;
- start -= 55;
- if( i == part) sum = summa;
- }
- printf("Total cost = %d\n", summa * full + sum);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement