1 solutions

  • 0
    @ 2025-11-5 15:44:23

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    long long n,a,t1,t2,t3,t4,t5,t6;
    int main()
    {
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		cin>>a;
    		if(a>=100)
    		    t1++;
    		else if(a>=90)
    		    t2++;
    		else if(a>=80)
    		    t3++;
    		else if(a>=70)
    		    t4++;
    		else if(a>=60)
    		    t5++;
    		else
    		    t6++;
    	}
    	cout<<t1<<"\n"<<t2<<"\n"<<t3<<"\n"<<t4<<"\n"<<t5<<"\n"<<t6;
    	
    	return 0;
    }
    

    Pascal :

    var
      score,n,a,b,c,d,e,f,i:integer;
    begin
      read(n);
      for i:=1 to n do
        begin
          read(score);
          if score<60 then f:=f+1 else if score<70 then e:=e+1
              else if  score<80 then d:=d+1 else if score<90 then c:=c+1
                 else if score<100 then b:=b+1 else a:=a+1;
        end;
      writeln(a);
      writeln(b);
      writeln(c);
      writeln(d);
      writeln(e);
      writeln(f);
    end.
    
    
    • 1

    Information

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