3 条题解

  • 0
    @ 2025-11-24 12:08:46
    
    #include <iostream>
    
    using namespace std;
    
    int main()
    {   
        int n;
        cin >> n;
    
        double arr[n];
        for(int i = 0; i < n; i++)
        {
            cin >> arr[i];
        }   
        
        
        for(int j = 0; j < n; j++)
        {
            if(arr[j] > 0)
            {   
    
                cout << (int)arr[j] + ((int)arr[j] == arr[j] ? 0 : 1) << " " << (int)arr[j] << endl;
            }
    
            else if((int)arr[j] < 0)
            {
                cout << (int)arr[j]<< " " << (int)arr[j] + ((int)arr[j] == arr[j] ? 0 : -1)  << endl;
            }
        }
    
        return 0;
    }
    • 0
      @ 2025-10-16 22:22:06
      #include<stdio.h>
      #include<math.h>
      
      int main(){
      	
      	int n;
      	scanf("%d",&n);
      	
      	int i;
      	double tot[1000];
      	for(i=0;i<n;i++){
      		scanf("%lf",&tot[i]);
      	}
      	
      	for(i=0;i<n;i++){
      			printf("%.0lf %.0lf\n",ceil(tot[i]),floor(tot[i]));
      	}
      	
      
      	return 0;
      }
      
      
      • 0
        @ 2025-10-2 14:38:12

        这一题调用函数就秒了,注意输出格式,对应一个输入只有一行输出。

        #include<stdio.h>
        #include<math.h>
        
        
        int main(){
        	int i,n;scanf("%d",&n);
        	double x;
        	for(i=0;i<n;i++){
        		scanf("%lf",&x);
        		printf("%.0lf ",ceil(x));
        		printf("%.0lf\n",floor(x));
        	}
        	return 0;
        }
        
        • 1

        信息

        ID
        238
        时间
        1000ms
        内存
        256MiB
        难度
        7
        标签
        递交数
        646
        已通过
        170
        上传者