#include<iostream>
#include<cstring>
using namespace std;
int main()
{
char str[100];
int i,j,n;
int flag;
while(cin>>str)
{
n=strlen(str);
for( i=0;i<n;i++)
{
flag=0;
for(j=i+1 ;j<n;j++)
{
if(str[i]==str[j] && str[i]!=' ')
{
if(flag==0)
{
cout<<str[i]<<":"<<i;
flag=1;
}
if(flag==1)
{
cout<<","<<str[j]<<":"<<j;
str[j]=' ';
}
}
}
if(flag==1)
{
cout<<endl;
}
}
}
// cout<<i<<endl;
return 0;
}
题目1199:找位置
最新推荐文章于 2020-04-10 12:57:13 发布