Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include "conio.h"
- #include "locale.h"
- #define _USE_MATH_DEFINES
- #include "math.h"
- int main()
- {
- setlocale(LC_ALL, "Rus");
- int k, s, d, e, sum, pr;
- printf("Введите число\n");
- scanf("%d", &k);
- s = k / 100;
- d = (k % 100) / 10;
- e = k % 10;
- sum = s + d + e;
- pr = s * d * e;
- printf("Сумма чисел %d\n", sum);
- printf("Произведение цифр %d\n", pr);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement