Advertisement
Kentoo

Sonya#1.3 rev 2.0

Dec 3rd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include "stdio.h"
  2. #include "conio.h"
  3. #include "locale.h"
  4. #define _USE_MATH_DEFINES
  5. #include "math.h"
  6.  
  7. int main()
  8. {
  9.     setlocale(LC_ALL, "Rus");
  10.     int k, s, d, e, sum, pr;
  11.     printf("Введите число\n");
  12.     scanf("%d", &k);
  13.     s = k / 100;
  14.     d = (k % 100) / 10;
  15.     e = k % 10;
  16.     sum = s + d + e;
  17.     pr = s * d * e;
  18.     printf("Сумма чисел %d\n", sum);
  19.     printf("Произведение цифр %d\n", pr);
  20.     getch();
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement