您的位置:首页 > 其它

杭电acm1860

2015-10-26 14:15 239 查看
#include <stdio.h>

int main() {

char d1[6];

char c;

int book[6];

int ids, i;

while(~scanf("%c", &c) && c!='#') {

ids = 0;

for(i=0; i<6; i++)

book[i] = 0;

while(c != '\n') {

//printf("\n error1 \n");

d1[ids++] = c;

//printf("\n error12 %c error\n", d1[ids-1]);

scanf("%c", &c);

//printf("\n error13 \n");

}

while(scanf("%c", &c)) {

if(c == '\n')

break;

//printf("\n error2 \n");

for(i=0; i<ids; i++)

if(c == d1[i])

book[i] ++;

}

for(i=0; i<ids; i++)

printf("%c %d\n", d1[i], book[i]);

}

return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: