高普考題庫
113 年 113年公務人員高等考試三級考試暨普通考試・計算機概要
30根據下列的C++語言函數宣告,呼叫calculate(“world peace”),函數的回傳值為何?#include <iostream>using namespace std;int calculate(string s) {int x =0;for (int i=0; i<s.length(); i++)if (s[i] == 'd')x++;return x;}