Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include "locale.h"
- void main() {
- setlocale(LC_ALL, "rus");
- int n, count = 0, sum = 0;
- printf("Введите число: ");
- scanf_s("%d", &n);
- while (n > 0) {
- sum += n % 10;
- count++;
- n = n / 10;
- }
- printf("Кол-во цифр %d, сумма цифр %d", count, sum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement