Previous Next
0 / 23
Module DEMO-32-108DEMO-C-32

Count Digits

DEMO-C-32 โ€ข Programming in C

Browser-only practice

Problem Statement

Write a program that scans a string and counts how many numeric digit characters (0-9) it contains.

Constraints

Max string length: 100

Input Format

Input:

String S

Output Format

Output:

Count

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
Date#1
1
There are 1 digits in the string Date#1.
Sample #2
Public sample
Bug#19
2
There are 1 digits in the string Bug#9.
Sample #3
Public sample
Vue!7
1
There are 1 digits in the string Vue!7.
Sample #4
Public sample
Packet?1
1
There are 1 digits in the string Packet?1.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings