6 solutions

  • 2
    @ 2023-11-22 16:34:23

    一个大水题

    #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
      @ 2024-10-25 19:26:03
      #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
        @ 2023-12-1 19:53:14
        #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
        @ 2023-11-17 19:13:49
        #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
          @ 2023-11-25 15:02:15
          #include<bits/stdc++.h>
          using namespace std;
          int main(){
          	int zd=0;
          	char a[100000];
          	gets(a);
          	int s=strlen(a);
          	for(int i=0;i<s;i++){ 
          		int b=a[i]-48;
          		if(b>9){
          			b=a[i]-54;
          		}
          		zd=max(zd,b);
          	}
          	if(zd>10){
          		cout<<zd;
          	}else{
          		cout<<zd+1; 
          	}  
          }
          
          • -2
            @ 2023-12-5 20:25:11
            #include<iostream>
            #include<algorithm>
            using namespace std;
            bool px(char a,char b){
            	return a>b;
            } 
            int main(){
            	char a[10000];
            	cin
            	>>a;
            	string alen=a;
            	int len=alen.size();
            	sort(a,a+len,px);
            	if(a[0]<'9'+1){
            		cout
            		<<1+int(a[0]-'0');
            	}
            	else{
            		cout
            		<<11+int(a[0]-'A');
            	}
            }
            
            • 1

            Information

            ID
            185
            Time
            1000ms
            Memory
            64MiB
            Difficulty
            6
            Tags
            # Submissions
            125
            Accepted
            37
            Uploaded By