标签:blog io strong for ar div log sp 时间
I THIS IS A TEST i ng this is a long test string #
I 2 i 3 5 n 2 g 2
#include <stdio.h>
int main(void)
{
char s[5];
while( gets(s) )
{
if(s[0] == ‘#‘)
break;
int count[256] = {0}; // 空间换时间
char second[80];
gets(second);
int i;
for(i=0; second[i]!=‘\0‘; ++i)
++count[second[i]];
for(i=0; s[i]!=‘\0‘; ++i)
printf("%c %d\n", s[i], count[s[i]]);
}
return 0;
}
标签:blog io strong for ar div log sp 时间
原文地址:http://www.cnblogs.com/DayByDay/p/3939863.html