Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156935 赵奕杰 统计数字字符个数 C++ Accepted 1 MS 276 KB 422 2026-07-11 15:31:23

Tests(10/10):


Code:

#include <iostream> #include <string> using namespace std; int main() { string str; getline(cin, str); // 限制长度不超过255 if (str.length() > 255) { str = str.substr(0, 255); } int count = 0; for (char c : str) { if (c >= '0' && c <= '9') { count++; } } cout << count << endl; return 0; }