注意输出是占三位,其他的挺水

#include<stdio.h>
#include<algorithm>
using namespace std;


int main(){
    int M,N;scanf("%d %d",&M,&N);
    int A,B;scanf("%d %d",&A,&B);
    int hui;scanf("%d",&hui);
    int arr[M][N];
    for(int i=0;i<M;i++){
        for(int j=0;j<N;j++){
            scanf("%d",&arr[i][j]);
            int temp=arr[i][j];
            if(temp>=A&&temp<=B)
                arr[i][j]=hui;
        }
    }
    for(int i=0;i<M;i++){
        for(int j=0;j<N;j++){
            if(j!=0) printf(" ");
            printf("%03d",arr[i][j]);
        }
        printf("\n");
    }
    return 0;
}

相关文章:

  • 2022-12-23
  • 2021-05-18
  • 2021-10-26
  • 2021-06-27
  • 2021-10-07
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
猜你喜欢
  • 2021-11-06
  • 2022-12-23
  • 2021-12-31
  • 2021-05-26
  • 2021-08-18
  • 2021-09-30
  • 2022-12-23
相关资源
相似解决方案