Login
Register
Problem list
Online status
lycoris
:
2024-03-08 16:23:52
#include
using namespace std; int main() { int n, a, b; cin >> n; cin.ignore(); for (int i = 0; i < n; i++) { int count = 0; char c[110]; cin.getline(c, 110); // Specify the maximum number of characters to read for (int j = 0; j < strlen(c); j++) { if (c[j] >= '0' && c[j] <= '9') { count++; } } cout << count << endl; } }
214793
:
2021-10-22 16:48:32
#include
#include
#include
using namespace std; int main() { int n; int a[100] = {}; cin >> n; cin.ignore(); for (int i = 0; i < n; i++) { int count = 0; char s[100]; cin.getline(s, 100, '\n'); for (int i = 0; i < strlen(s); i++) { if (s[i] <= '9' && s[i] >= '0') count++; } a[i] = count; } for (int i = 0; i < n; i++) cout << a[i] << endl; }
1
:
2020-07-19 16:06:43
#include
int main() { int n; char c[110]; scanf("%d", &n); fgets(c, 110, stdin); for(int i=0; i
Post Your Comment