Accepted
Code
/*
* Copyright (c) 2024 Emon Thakur
* All rights reserved.
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t; cin>>t; while(t--)
{
string s; cin>>s;
int ans = 0;
for(auto e:s)
{
if(e>='0' && e<='9')
{
ans += (e-'0');
}
}
cout<<ans<<endl;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1072 Valuable digit
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-07-14 15:00:41
- Judged At
- 2024-07-14 15:00:41
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 540.0 KiB