填空题
有以下程序:
#include <iostream>
using namespace std;
const xnt N=5;
int fun(char *s,char a,int n)
{
int j;
*s=a;j=n;
while(a<s[j])
j--;
return j;
}
int main()
{
char s[N+1];
int k;
for(k=0;k<=N;k++)
s[k]=’A’+k+1;
cout<<fun(s,’E’,N)<<end1;
return 0;
}
运行后的打印结果是 【8】 。
【参考答案】
C