CE!!你妹的编译器!!!
#include <iostream> #include <stdio.h> #include <string.h> #include <cstring> using namespace std; const int maxn=260; int s[maxn]; int flag[maxn]; int a[maxn][maxn]; int n,m,Min; int cc=0; int main() { int i,j; while (scanf(\"%d%d\",&n,&m)!=EOF) { memset(flag,0,sizeof(flag)); for (i=1;i<=n;i++) for (j=1;j<=m;j++) { scanf(\"%d\",&a[i][j]); flag[a[i][j]]++; } printf(\"Case %d:\\n\",++cc); int t=0; for (i=0;i<maxn;i++) if (flag[i]>0) t++; if (t==1) { for (i=1;i<=n;i++) { for (j=1;j<=m;j++) printf(\"%d \",a[i][j]); printf(\"\\n\"); } continue; } s[0]=flag[0]; Min=999999999; if (s[0]>0 && s[0]>Min) Min=s[0]; for (i=1;i<maxn;i++) { s[i]=s[i-1]+flag[i]; if (s[i]>0 && s[i]<Min) Min=s[i]; } for (i=1;i<=n;i++) { for (j=1;j<=m;j++) a[i][j]=(int)((double)(s[a[i][j]]-Min)/(m*n-Min)*(256-1)); } for (i=1;i<=n;i++) { for (j=1;j<=m;j++) printf(\"%d \",a[i][j]); printf(\"\\n\"); } } return 0; %0