题海让大学四年没有难题
白天模式登陆

题目详情

单选题 The ? mark in the following code should be replaced by ___________. #include <iostream> #include <cctype> #include <cstring> using namespace std; int countLetters(const char s[ ]) { int count = 0; for (int i = 0; i < ? ; i++) { if (isalpha(s[i])) count++; } return count; } int main( ) { // Prompt the user to enter a string cout << "Enter a string: "; char s[80]; cin.getline(s, 80); cout << "The number of letters in " << s << " is " << countLetters(s) << endl; return 0; }

A. 80

B. 79

C. strlen(s)

D. strlen(s) – 1

C++语言程序设计课程封面

学科:C++语言程序设计

时间:2026-03-24 23:33:53

Copyright © 2022 津ICP备2021001502号