fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int t;
  5. scanf("%d",&t);
  6. while(t--)
  7. {
  8. int x,i,a=25;
  9.  
  10. scanf("%d",&x);
  11. char st[26]={0};
  12. char st1[100];
  13. for(i=0;i<x;i++)
  14. {
  15. scanf(" %c",&st1[i]);///zzz
  16. st[st1[i]-'a']++;
  17. }
  18. st1[x+1]='\0';
  19. for(i=a;i>=0;i--)
  20. {if(st[i]>0)
  21. {
  22. printf("%d\n",i+1);
  23. break;
  24. }
  25.  
  26. }
  27.  
  28. }
  29.  
  30.  
  31.  
  32. return 0;
  33. }
  34.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Standard output is empty