Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int Dima(int n);
- ///////////////////////////////////////////
- int main() //
- {
- int nSerial = 0, // 5845
- nOst = 0, // lkjkljlkjl
- n = 0;
- scanf("%d", &n);
- nSerial = n/7;
- nOst = n%7;
- int n2 = Dima(nOst);
- n2 = n2 + (nSerial * 5845);
- printf("n2 = %d\n", n2);
- }
- /////////////////////////////////////////////
- int Dima(int n) //
- {
- int nSumma = 0,
- nPrice = 1000,
- i = 1;
- while(i <= n)
- {
- nSumma = nSumma + nPrice;
- nPrice = nPrice - 55;
- i += 1;
- }
- return nSumma;
- }
- /*
- /////////////////////////////////////////////
- int Dima(int n) //
- {
- int nSumma = 0;
- switch(n)
- {
- case 0: break;
- case 1: nSumma = 1000; break;
- case 2: nSumma = 1945; break;
- case 3: return 2835;
- }
- return nSumma;
- }
- */
- //printf("n = %d", n);
- /*
- #include <stdio.h>
- void foo(int, int );
- ///////////////////////////////////////////
- int main() //
- {
- int n1 = 23,
- n2 = 2045;
- foo(n2, n1);
- }
- ////////////////////////////////////////////
- void foo(int n1, int n2)
- {
- printf("n1 = %d, n2 = %d\n", n1, n2);
- }
- */
- /*
- #include <stdio.h>
- void SONY(int n);
- ///////////////////////////////////////////
- int main() //
- {
- for(int i = 2; i < 10; i++) SONY(i);
- }
- ////////////////////////////////////////////
- void SONY(int n) //
- {
- for(int i = 2; i < 10; i++)
- {
- printf("%d * %d =%4d\n", n, i, n*i);
- }
- printf("\n");
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement