|
|
back to boardGot WA test # 16!!! HELP! #include <cstdio> #include <cstring> char s1[10] = "Sandro", s2[10] = "sANDRO", l[205], n, a[10] = "Aaaaaa" , b[10] = "Zzzzzz"; int min = 60000; int main(){ scanf("%s", &l); n = strlen(l) - 5;
for ( int i = 0; i < n; i++ ){ int t = 0; for ( int j = 0; j < 6; j++ ){ if ( l[i+j] != s1[j] ){ if (!( l[i+j] == s2[j] || ( l[i+j] >= a[j] && l[i+j] <= b[j] ) )) t += 1; ++t; } } if ( t < min ) min = t; } printf("%d", min*5); scanf("\n"); return 0; } Re: Got WA test # 16!!! HELP! Edited by author 03.12.2011 02:02 Edited by author 03.12.2011 02:02 |
|
|