4 solutions

  • 0
    @ 2025-5-10 11:42:06

    #include<bits/stdc++.h> using namespace std; const int N=100010; int a[N],b[N]; int main() { char a,b,c; cin>>a>>b>>c; if(ab&&bc) cout<<-1; else if(ac) cout<<b; else if(bc) cout<<a; else if(a==b) cout<<c; else cout<<a; return 0; }

    • 0
      @ 2025-5-10 11:41:54

      #include<bits/stdc++.h> using namespace std; int main() { char a,b,c; cin>>a>>b>>c; if(ab&&ac&&bc) { cout<<"-1"; } else if(ab) { cout<<c; } else if(ac) { cout<<b; } else if(bc) { cout<<a; } else { cout<<a; }

      return 0;
      

      }

      • 0
        @ 2025-5-10 11:41:45
        #include<bits/stdc++.h>
        using namespace std;
        const int N=100010;
        int a[N],b[N]; 
        int main()
        {
        	char a,b,c;
        	cin>>a>>b>>c;
        	if(a==b&&b==c) cout<<-1;
        	else if(a==c) cout<<b;
        	else if(b==c) cout<<a; 
        	else if(a==b) cout<<c;
        	else cout<<a; 
        	return 0;
        }
        • 0
          @ 2025-5-10 11:41:35

          #include<bits/stdc++.h> using namespace std; int main() { char a,b,c; cin>>a>>b>>c; if(ab&&ac&&bc) { cout<<"-1"; } else if(ab) { cout<<c; } else if(ac) { cout<<b; } else if(bc) { cout<<a; } else { cout<<a; }

          return 0;
          

          }

          • 1

          Information

          ID
          2369
          Time
          1000ms
          Memory
          256MiB
          Difficulty
          1
          Tags
          (None)
          # Submissions
          45
          Accepted
          21
          Uploaded By