someone help me please for http://www.spoj.com/problems/FINDSR/
is my logic wrong??
tell any case where my code fail......
#include<iostream>
#include<map>
#include<string.h>
#include<stdio.h>
using namespace std;
int main(){
while(1){
//map<char,int>mp;
char a[100002];
scanf("%s",&a);
if(a[0]=='*')
break;
int max=0,i=0;
while(a[i]!='\0'){
if(a[0]==a[i])
max++;
i++;
}
printf("%d\n",max);
}
return 0;
}