Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int nStartPrice = 1000,
- nDelta = 55;
- int Serial (int n);
- int Ostatok(int n);
- ////////////////////////////////////////////////////////
- int main() //
- {
- int nX;// = Serial(2);
- scanf("%d", &nX); // 8
- int nS = nX/7,
- nO = nX%7;
- nO = Ostatok(nO);
- nS = Serial(nS);
- nX = nO + nS;
- printf("Summa = %d\n", nX);
- }
- ////////////////////////////////////////////////////////
- int Ostatok(int n) // <= 7!
- {
- int nSumma = 0,
- nSP = 1000;//nStartPrice;
- for(int i = 0; i < n; i ++)
- {
- nSumma = nSumma + nSP;
- nSP -= 55; // nSP = nSP - 55;
- }
- return nSumma;
- }
- ////////////////////////////////////////////////////////
- int Serial(int n)
- {
- int nSumma = 0,
- nSP = 1000;//nStartPrice;
- for(int i = 0; i < 7; i ++)
- {
- nSumma = nSumma + nSP;
- nSP -= 55; // nSP = nSP - 55;
- }
- return nSumma * n;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement