ç¨coutç¼åc++æ¶æ¥åºå½æ°æ²¡æ声æçé误æ¯å 为没æincludeå°æè¦å¼ç¨çåºã
coutæå¨çåºæ¯iostreamï¼æ以è¦includeè¿æ¥ï¼å
¶ä»åºä¹ç±»ä¼¼ã
举ä¾ï¼
#include <locale>
#include <iostream>
#include <string>
using namespace std;
int main()
{
string Test;
int count = 0;
cout << "String ?: ";
cin >> Test;
cin.get();
for(int i = 0; i < Test.length(); i++)
{
char c = Test[i];
if(isupper(c) == true)
{
count += 1;
}
}
温馨提示:内容为网友见解,仅供参考