6 solutions
-
2
一个大水题
#include<iostream> #include<string> using namespace std; int main() { string a; int maxs=0; cin>>a;//输入 for(int i=0;i<a.size();i++) { char s=a[i]; int x; if(s>='0' && s<='9')//是数字 { x=s-48; } else//否则是字母 { x=s-65+10; } if(x>maxs)//是不是最大的 { maxs=x; } } cout<<++maxs;//是比他大一的 return 0; }
-
0
#include <bits/stdc++.h> using namespace std; char a; int x; char s; int main() { int max = 0; while(cin >> a)//输入 { s = a; if(s>='0' && s<='9')//是数字 { x=s-'0';//x是int,s是char,不知道为什么的人可以去看ASCLL码 } if(s>='A' && s<='Z')//是字母 { x=s-'A'+10;//x是int,s是char,如果s = A, x = 11以此类推 } if(x>max)//是不是最大的 { max=x; } } max++;//大一,例:十进制每位是0~9 cout<<max; return 0; }
-
0
#include<bits/stdc++.h> using namespace std; string a; int mx(int n){ int maxx=-1; while(n--){ if(a[n]>='0' && a[n]<='9') {if((int)(a[n]-'0')>=maxx) maxx=a[n]-'0';} else {if((int)(a[n]-'A'+10)>=maxx) maxx=a[n]-'A'+10;} } return maxx+1; } int main(){ cin>>a; cout<<mx(a.size()); return 0; } //////////sssssssss //fangweibiaoji...........n
-
0
#include <bits/stdc++.h> using namespace std; int main(int argc, char **argv){ string s;int jinzhi = 0; cin >> s; for (int i = 0;s[i];i++){ int t; if (s[i] >= '0' && s[i] <= '9'){ t = s[i] - '0'; }else if(s[i] >= 'A' && s[i] <= 'Z'){ t = s[i] - 'A' + 10; } jinzhi = max(jinzhi,t); } cout << jinzhi + 1; return 0; }
- 1
Information
- ID
- 185
- Time
- 1000ms
- Memory
- 64MiB
- Difficulty
- 6
- Tags
- # Submissions
- 125
- Accepted
- 37
- Uploaded By