28 条题解

  • 0
    @ 2024-3-12 21:06:27
    #include <iostream>
    #include <stdio.h>
    #include <math.h>
    #include <iomanip>
    using namespace std;
    const int N = 1e5 + 10;
    const int INF = 0x3f3f3f3f;
    int k , n , one , five , ten;
    int main()
    {
    	cin >> k;
    	for( int i = 1 ; i <= k ; i++ )
    	{
    		cin >> n;
    		if( n == 1 )
    		{
    			one += 1;
    		}
    		else if( n == 5 )
    		{
    			five += 1;
    		}
    		else if( n == 10 )
    		{
    			ten += 1;
    		}
    	}
    	cout << one << endl << five << endl << ten; 
        return 0;
    }
    
    
    • 0
      @ 2023-3-31 20:42:42

      #include<bits/stdc++.h> using namespace std; int main() { int n,a[101],b[4]={0}; cin>>n; for(int i=1; i<=n; i++) { cin>>a[i]; if(a[i]==1) b[1]++; if(a[i]==5) b[2]++; if(a[i]==10) b[3]++; } cout<<b[1]<<endl<<b[2]<<endl<<b[3]; return 0; }

      • 0
        @ 2023-3-19 13:43:29

        What water question!

        //Accepted code:
        #include <bits/stdc++.h>
        /*#include <iostream>
        #include <stdio.h>
        #include <stdbool.h>
        #include <iomanip>
        #include <cstdio>
        */
        
        //any function
        void sleep(int p){
        	long long int jiouiuiojioiouuiijyuiuyiyi = 0;
        	const int N = 1e5 + 10;
        	const int INF = 0x3f3f3f3f;
        	for(int k = 1;k <= p;k++){
        		for(int j = 1;j <= 300;j++){
        			for(int i = 1;i <= N;i++){
        			jiouiuiojioiouuiijyuiuyiyi += pow(N,N);
        			}
        		}
        	}
        }
        
        
        //code write block
        using namespace std;
        const int N = 1e5 + 10;
        const int INF = 0x3f3f3f3f;
        int n,one,five,ten;
        int main(){
        
        	cin >> n;
        	for(int i = 1;i <= n;i++){
        		int x;
        		cin >> x;
        		if(x == 1){
        			one++;
        		}
        		else if(x == 5){
        			five++;
        		}
        		else if(x == 10){
        			ten++;
        		}
        	}
        	cout << one << endl << five << endl << ten;
        	return 0;
        	}
        
        • 0
          @ 2022-7-5 22:10:13

          #include <stdio.h>

          #include

          using namespace std;

          int main()

          {

          int n ;
          
          int a,b,c;
          
          a = b = c = 0;
          
          cin >> n;
          
          for(int i = 0;i < n;i++ )
          
          {
          
              int x;
          
              cin >> x;
          
              if(x == 1)
          
                  a++;
          
              if(x == 5)
          
                  b++;
          
              if(x == 10)
          
                  c++;
          
          }
          
          cout << a << endl;
          
          cout << b << endl;
          
          cout << c << endl;
          

          }

          • 0
            @ 2022-7-5 8:39:49

            #include <stdio.h> #include #include using namespace std; int k,a,b,c,n; int main() {
            cin>>k; for(int i=0; i<k ;i++) {

            cin>>n;
            if(n==1)
            {
             a++;
            }
            
            if(n==5)
            {
            b=b+1;
            }
            
            if(n==10)
            {
            c=c+1;
            }
            
            }
            cout<<a<<endl;
            cout<<b<<endl;
            cout<<c<<endl;
            

            }

            • 0
              @ 2022-1-9 14:53:19
              #include <iostream>
              #include <math.h>
              #include <iomanip>
              using namespace std;
              #define LL Long Long
              const int N=1e5+10;
              const int INF=0x3f3f3f3f;
              int main()
              {
                  cin >> k;
                  for (int i = 1 ; i <= k ; i++)
                  {
                      cin >> n;
                      if (n==1)
                      {
                          a++;
                      }
                      
                      if (n==5)
                      {
                          b++;
                      }
                      if (n==10)
                      {
                          c++;
                      }
              }```
              • 0
                @ 2022-1-9 11:23:55
                #include<iostream>
                #include<cstdio>
                #include<cstdlib>
                int k,n,a,b,c;
                using namespace std;
                int main()
                
                {
                    cin>>k;
                    
                    for (int i = 1; i <= k; i++)
                    {
                        cin>>n;
                        if (n==1)
                        {
                            a++;
                        }
                        
                        if (n==5)
                        {
                            b++;
                        }
                        if (n==10)
                        {
                            c++;
                        }
                    }
                    cout<<a<<endl<<b<<endl<<c;
                }
                
                • -1
                  @ 2025-12-20 18:25:10
                  #include<iostream>
                  using namespace std;
                  int s[10000];
                  int a=0;
                  int b=0;
                  int c=0;
                  int main()
                  {
                  	int k;
                  	cin>>k;
                  	for(int i=1;i<=k;i++)
                  	{
                  		cin>>s[i];
                  		if(s[i]==1)
                  		{
                  			a++;
                  		}
                  		else if(s[i]==5)
                  		{
                  			b++;
                  		}
                  		else if(s[i]==10)
                  		{
                  			c++;
                  		}
                  	}
                  	cout<<a<<endl;
                  	cout<<b<<endl;
                  	cout<<c<<endl;
                  	return 0;
                  }
                  
                  
                  

                  信息

                  ID
                  972
                  时间
                  1000ms
                  内存
                  128MiB
                  难度
                  3
                  标签
                  递交数
                  852
                  已通过
                  444
                  上传者