查找最大元素
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28807 Accepted Submission(s): 15937
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i; char s[100],max; while(gets(s)) { max='A'; for(i=0;i<strlen(s);i++) if(s[i]>=max) max=s[i]; for(i=0;i<strlen(s);i++) { printf("%c",s[i]); if(s[i]==max) printf("(max)"); } printf("\n"); } return 0; }