Results 1 to 4 of 4
Thread: Can translate?
 10222010, 04:27 AM #1Member
 Join Date
 Oct 2010
 Posts
 1
 Rep Power
 0
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?
Java 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][p1],a[i+s][j+s][p1]) , MIN(a[i+s][j][p1],a[i][j+s][p1]) ); 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; }
 10222010, 04:35 AM #2Senior Member
 Join Date
 May 2010
 Posts
 436
 Rep Power
 10
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.
 10222010, 04:51 AM #3
Do you know any Java at all? And what is this for, school?
Sincerely, Joshua Green
Please REP if I help :)
 10222010, 09:11 AM #4Moderator
 Join Date
 Apr 2009
 Posts
 13,541
 Rep Power
 26
Similar Threads

Translate from C to java
By ighor10 in forum New To JavaReplies: 6Last Post: 03272010, 09:24 PM
Bookmarks