HSG THPT Hải Phòng 2023 - Bài 2

View as PDF

Submit solution


Points: 0.01 (partial)
Time limit: 1.0s
Memory limit: 256M
Input: stdin
Output: stdout

Author:
Problem source:
Kỳ thi Học sinh giỏi THPT TP Hải Phòng 2023
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

Please read the guidelines before commenting.



  • -1
    nguyenhoangminhmethzyy  commented on Feb. 21, 2025, 1:41 p.m.

    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


  • 0
    lenguyenminhkhang2b  commented on Jan. 28, 2024, 3:04 p.m.

    cho mình hỏi là nộp pascal thì ac có 3 mà nộp py thì ac full vậy ạ =))


    • -6
      khieudung123  commented on Feb. 16, 2024, 9:25 a.m.

      This comment is hidden due to too much negative feedback. Show it anyway.