fork download
  1. /**
  2.  * author: orzvanh14 ( Độc cô cầu đặc )
  3.  * created: 18.04.2026 03:56:02
  4.  * too lazy to update time
  5. **/
  6. // i wants to take ioi
  7. //binhtinhtutinkhongcaycunhungmotkhikhongcontutinnualatuyetvong
  8. #include <bits/stdc++.h>
  9.  
  10. using namespace std;
  11.  
  12. #define int long long
  13. #define nn "\n"
  14. #define pi pair<int, int>
  15. #define ti tuple<int, int, int>
  16. #define fi first
  17. #define se second
  18. #define lb lower_bound
  19. #define ub upper_bound
  20. #define eb emplace_back
  21. #define pb push_back
  22. #define TASK " "
  23.  
  24. #define ms(a, x) memset(a, x, sizeof(a))
  25. #define all(a) a.begin(), a.end()
  26. #define All(a, n) a + 1, a + 1 + n
  27.  
  28. #define LOG 19
  29.  
  30. const int INF = 1e18;
  31. const int N = 1e4 + 5;
  32. const int maxn = 100 + 5;
  33. const int mod = 1e9 + 7;
  34.  
  35.  
  36. struct node{
  37. int kc, u;
  38. bool operator<(const node& other) const {
  39. return kc > other.kc;
  40. }
  41. };
  42. struct edge{
  43. int v, w, h;
  44. };
  45. string s;
  46. int cnt = 0;
  47.  
  48. void nhap(){
  49. cin >> s;
  50. }
  51. void solve(){
  52. for(char c : s){
  53. int x = c - '0';
  54. if(x >= 0 && x <=9) cnt++;
  55. }
  56. cout << cnt << nn;
  57. }
  58. signed main(){
  59. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  60. // freopen("CHONBI.INP", "r", stdin);
  61. // freopen("CHONBI.OUT", "w", stdout);
  62. nhap();
  63. solve();
  64. return 0;
  65. }
  66.  
Success #stdin #stdout 0s 5316KB
stdin
aba812abc
stdout
3