Submit solution
Points:
0.01 (partial)
Time limit:
1.0s
Memory limit:
256M
Input:
stdin
Output:
stdout
Author:
Problem source:
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch
Cho xâu kí tự ~S~ chỉ bao gồm các ký tự chữ cái Latin in thường và ký tự chữ số. Viết chương trình đếm số lượng ký tự chữ số trong xâu ~S~.
Input
Gồm 1 dòng duy nhất chứa xâu ký tự ~S~. Độ dài xâu ~S~ không vượt quá ~250~ ký tự.
Output
Gồm một số nguyên duy nhất là số lượng ký tự chữ số trong xâu ~S~.
Sample Input 1
aba812abc
Sample Output 1
3
Notes
Có ~3~ ký tự chữ số là ~8~, ~1~, ~2~.
Comments
include<bits/stdc++.h>
using namespace std; string s; int dem=0; signed main (){ cin >> s; for (int i=0;i<=s.length()-1;i++){ if ('0'<=s[i] && s[i]<='9') dem++; } cout << dem; } //nghminh0109
cho mình hỏi là nộp pascal thì ac có 3 mà nộp py thì ac full vậy ạ =))
This comment is hidden due to too much negative feedback. Show it anyway.