1 solutions

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

    C :

    #include<stdio.h>
    int main(){
    	int a[10],i;
    	for(i=0;i<10;i++){
    		scanf("%d",&a[i]);
    	}
    	int h,ct=0;
    	scanf("%d",&h);
    	for(i=0;i<10;i++){
    		if(h+30>=a[i]){
    			ct++;
    		}
    	}
    	printf("%d",ct);
    	return 0;
    }
    
    

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){
    	int a[10],h,c = 0;
    	int i;
    	for(i = 0;i < 10;i++){
    		cin>>a[i];
    	} 
    	
    	cin>>h;
    	
    	for(i = 0;i < 10;i++){
    		if(h + 30 >= a[i]){
    			c++;
    		}
    	} 
    	
    	cout<<c<<endl;
    	 
        return 0;
    }
    
    

    Python :

    s = input().split()
    n = int(input())
    l = []
    c = 0
    for v in s:
        l.append(int(v))
    for i in range(0, len(l)):
        if n + 30 >= l[i]:
            c += 1
    print(c)
    
    
    • 1

    Information

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