# Can translate?

• 10-22-2010, 04:27 AM
workmason
Can translate?
Hey guys, I know this is ridiculous. But I'm really dumb in JAVA Programming.
I wrote these codes in C, but I need to submit it in JAVA codes. Can someone help me out on this? Can someone translate it for me?

Code:

```#include<stdio.h> #define SZ 1001 #define MIN(a,b) ((a)<(b)?(a):(b)) int a[SZ][SZ][11]; int n,k,i,j,x,s,p,q,size; int main(){ scanf("%d%d",&n,&k); for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&a[i][j][0]); for(p=1,s=1;(1<<p)<=k;p++,s*=2) for(i=0;i+s<n;i++) for(j=0;j+s<n;j++) a[i][j][p] = MIN( MIN(a[i][j][p-1],a[i+s][j+s][p-1]) , MIN(a[i+s][j][p-1],a[i][j+s][p-1]) ); s = 0; while(2*(1<<s)<=k) s++; x = k - (1<<s); for(i=0;i+k<=n;i++){ for(j=0;j+k<=n;j++){ printf("%d",MIN( MIN(a[i][j][s],a[i+x][j+x][s]) , MIN(a[i+x][j][s],a[i][j+x][s]) )); if(j+k!=n) printf(" "); } if(i+k!=n) printf("\n"); } return 0; }```
• 10-22-2010, 04:35 AM
curmudgeon
This ain't a "here's my problem, now code this for me site", so for gosh sake, put in at least some effort. You can find the tutorials here: The Really Big Index

These should get you started in learning how to code Java. Then please feel free to come on back when you show that you're willing to put in at least as much effort as you ask of us.
• 10-22-2010, 04:51 AM
joshdgreen
Do you know any Java at all? And what is this for, school?
• 10-22-2010, 09:11 AM
Tolls
You wrote that in C?
Without any indentation?

...

ETA: What does it do?