3 solutions

  • 0
    @ 2022-11-26 18:16:54
    #include<iostream>
    #include<iomanip>  // --->setprecision所需头文件
    using namespace std;
    
    int main(){
    	int T, n;
    	double ans;
    	cin >> T;
    	for(int i = 1; i <= T; i++){
    		cin >> n;
    		
    		if(n < 60)
    			cout << "0.0" << endl;
    		else{
    			ans = 1.0 * (n - 60) / 10 + 1;
    			cout << setprecision(1) << fixed<< ans << endl;	//保留一位小数
    		}		
    	}
    	
    	return 0;
    }
    
    • 0
      @ 2022-4-5 1:32:47

      还好

      #include <iostream>
      using namespace std;
      int main()
      {
          int T = 0;
          cin >> T;
          while(T--)
          {
              int n =0;
              cin >> n;
              if(n<60)    cout << "0.0" << endl;
              else
              {
                  double d = 1.0 * (n-60)/10+1;
                  printf("%.1f", d);
                  printf("\n");
      
              }
          }
          return 0;
      }
      
      • 0
        @ 2022-3-7 22:11:56
        #include <stdio.h>
        #include <algorithm>
        #include <math.h>
        using namespace std;
        int n;
        int main() {
            scanf("%d",&n);
            while(n--)
            {
                double tmp;
                scanf("%lf",&tmp);
                if(tmp<60)
                    printf("0.0\n");
                else
                {
                    double ans=(tmp-60)/10+1;
                    printf("%.1lf\n",ans);
                }
        
            }
        
        
            return 0;
        }
        
        
        • 1

        Information

        ID
        23
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        7
        Tags
        # Submissions
        944
        Accepted
        231
        Uploaded By