Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- #include <stdlib.h>
- #include <math.h>
- int summ(int quantity, int parametr, ...)
- {
- int sum=0, *p=¶metr;
- while (quantity--)
- {
- sum+=pow(*p,2); //âîçâåäåíèå â ñòåïåíü
- p++;
- }
- return sum;
- }
- int main()
- {
- printf("summ = %i\n", summ(2, 3, 5, 7, 9, 1));
- printf("summ = %i\n", summ(7, 1, 2, 1, 1, 1, 1, 1));
- printf("summ = %i\n", summ(4, 0, 0, 4, 4));
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement