发布网友 发布时间:2022-09-22 09:08
共1个回答
热心网友 时间:2023-11-24 17:10
#include<iostream>
#include<cstdlib>
using namespace std;
int main(void)
{
int a[60];
srand(9);
int fw=132-65;
int ca=0,ce=0;
cout<<"数组:"<<endl;
for(int i=0;i<60;i++){
a[i]=65+rand()%fw;
if(a[i]=='A')ca++;
if(a[i]=='E')ce++;
cout<<a[i]<<" ";
}
cout<<endl;
cout<<"一共发现"<<ca<<"个A,"<<ce<<"个E"<<endl;
return 0;
}