太好了!!!
我朋友帮我做了一个(见下),但是看不懂,好像不是C++的。大家能帮忙改改吗?感激不尽啊!
#include <cstdio>
#include <memory>
int count[256];
int main()
{
int i;
char ch;
memset(count,0,sizeof(count));
for (i=0;i<200;i++)
{
scanf("%c",&ch);
count[ch]++;
}
for (i='A';i<='Z';i++)
printf("The frequency of %c is %lf\n",i,count[i]/200.0);
for (i='a';i<='a';i++)
printf("The frequency of %c is %lf\n",i,count[i]/200.0);
return 0;
}
我朋友帮我做了一个(见下),但是看不懂,好像不是C++的。大家能帮忙改改吗?感激不尽啊!
#include <cstdio>
#include <memory>
int count[256];
int main()
{
int i;
char ch;
memset(count,0,sizeof(count));
for (i=0;i<200;i++)
{
scanf("%c",&ch);
count[ch]++;
}
for (i='A';i<='Z';i++)
printf("The frequency of %c is %lf\n",i,count[i]/200.0);
for (i='a';i<='a';i++)
printf("The frequency of %c is %lf\n",i,count[i]/200.0);
return 0;
}