2 solutions

  • 1
    @ 2026-9-13 15:07:23
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        char s[105];
        int a=0;
        cin.getline(s,105);
        if(s[0]<='z' and s[0]>='a'){
                cout<<"No";
                return 0;
            }
        for(int i=1;s[i]!='\0';i+=1){
            if(s[i]<='Z' and s[i]>='A'){
                cout<<"No";
                return 0;
            }
            
    	}
    	cout<<"Yes";
    	return 0;
    }
    
    • 1
      @ 2026-7-7 10:26:03
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
      	string s;
      	cin>>s;
      	int cnt=0;
      	int n=s.size();
      	bool st=true;
      	for(int i=1;i<n;i++)
      	{
      		if(s[i]>='A'&&s[i]<='Z')
      		{
      			st=false;	
      		}	
      	} 
      	if(st&&s[0]>='A'&&s[0]<='Z')
      	{
      		cout<<"Yes";
      	}
      	else
      	{
      		cout<<"No";
      	}
      	return 0;
      }
      
      
      • 1

      Information

      ID
      2410
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      127
      Accepted
      33
      Uploaded By