Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int foo(int);
- ///////////////////////////////////////////////////////////////
- int main()
- {
- int n = 21,
- nSerial = n/7,
- nOstatoc = n%7,
- nSumma = 0;
- nSumma = nSerial * foo(7);
- nSumma += foo(nOstatoc);
- printf("nSumma = %d \n", nSumma);
- }
- /////////////////////////////////////////////////////////////////
- int foo(int nOstatoc)
- {
- int nSumma = 0,
- nPrice = 1000;
- for(int i = 0; i < nOstatoc; i++)
- {
- nSumma += nPrice;
- nPrice -= 55;
- }
- return nSumma;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement