1 solutions

  • 0
    @ 2025-3-3 16:33:49

    C :

    #include<stdio.h>
    
    int main()
    {
    	int n;
    	scanf("%d",&n);
    	char a[n],i;
    	for(i=0;i<n;i++){
    		scanf("%s",&a[i]);
    	}
    	int s=0;
    		for(i=0;i<n;i++){
    			if(a[0]>='A'&&a[0]<='G'||a[0]>='R'&&a[0]<='T'){
    				s++;
    		}
    		break;
    				}
    				printf("%d",n-s);
    	
    	
    
    
    
    return 0;
    }
    
    

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n,i,c=0;
    	string s;
    	cin>>n;
    	for (i=1;i<=n;i++) {
    		cin>>s;
    		if (s[0]>='H' && s[0]<='Q') {
    			c++;	
    		} 
    		if (s[0]>='U' && s[0]<='Z') {
    			c++;
    		}
    	}
    	cout<<c<<endl;
    
    	return 0;
    }
    
    

    Python :

    n=int(input())
    js=0
    for i in range(1,n+1):
        sr=input()
        if (sr[0]>="A" and sr[0]<="G") or (sr[0]>="R" and sr[0]<="T"):
            js=js+1
    print(n-js)
    
    • 1

    Information

    ID
    10773
    Time
    1000ms
    Memory
    32MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By