Search found 8 matches

by rezaee
Wed Dec 20, 2006 9:15 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 23058

108 maximum sum

i get a WA. please help me. #include <iostream.h> int n; int b[101][101]; void sefr(void) {for(int i=0;i<=n;i++) {b[0][i]=0;b[i][0]=0;} } void main() { int a[101][101]; int i,j,k; int max; int temp; while(cin>>n) {if(n==0)break; max=-127; sefr(); for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { cin>>a[i][j];...
by rezaee
Wed Dec 20, 2006 9:14 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 23058

108 maximum sum

help me.
by rezaee
Wed Dec 20, 2006 5:22 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 23058

108 maximum sum

ok.

but my code does work correctly.

in my compiler.

:(

i dont know what to do.
by rezaee
Wed Dec 20, 2006 12:51 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 23058

108 maximum sum

oh.ok. but i get WA. #include <iostream.h> int n; int b[101][101]; int main() { int a[101][101]; int i,j,k; int max; int s; while(cin>>n) {max=-127; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { cin>>a [j]; if(a [j]>max) { max=a [j]; } b [j]=b[i-1][j]+b [j-1]-b[i-1][j-1]+a [j]; if(b [j]>max) { max=b [j]; ...
by rezaee
Tue Dec 19, 2006 11:22 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 23058

108 help meeeee

it is my code. but i get a WA. #include <iostream.h> int n; int b[101][101]; int main() { int a[101][101]; int i,j,k; int max; int s; while(cin>>n) {max=-127; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { cin>>a [j]; if(a [j]>max) { max=a [j]; } b [j]=b[i-1][j]+b [j-1]-b[i-1][j-1]+a [j]; if(b [j]>max) { m...
by rezaee
Wed Dec 13, 2006 5:46 pm
Forum: Volume 9 (900-999)
Topic: 900 - Brick Wall Patterns
Replies: 16
Views: 9200

900 help me plz

#include <iostream.h> int fact(int n) {int p; p=1; if(n==0)return 1; else{ while(n!=0) {p*=n;n--;} return p;}} int max(int i,int j) {if(i>j)return i; else return j; } int combination(int j,int n) {int p,k; p=1; if(n==j) return 1; else{ k=n; while(k!=j) {p*=k;k--;} return p/fact(n-j);} } int main(vo...
by rezaee
Mon Dec 11, 2006 4:53 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 23058

108 help meeeee

#include <iostream.h> #include <stdio.h> int main(void) {int n,p,sum,max=-127; int m[100][100]; cin>>n; {{for(int i=0;i<n;i++) for(int j=0;j<n;j++) {cin>>p;m [j]=p;} for(int i=0;i<n;i++) for(int j=0;j<n;j++) for(int k=0;k<n;k++) for(int z=0;z<n;z++) {sum=0; for(int y=i;y<=j;y++) for(int x=k;x<=z;x++...
by rezaee
Sun Dec 10, 2006 8:37 pm
Forum: Volume 100 (10000-10099)
Topic: 10035 - Primary Arithmetic
Replies: 328
Views: 57700

10035 help me plz

#include <iostream.h> int main(void) {int unsigned long a,b; int s,z; int unsigned long q[10],d[10]; while(cin>>a>>b) {if((a==0)&&(b==0))return 0; else{for(int i=1;i<=9;i++) {q =0;d =0;} for(int j=9;j>=1;j--) {{q[j]=a%10;a=a/10;}{d[j]=b%10;b=b/10;}} s=0; for(int k=9;k>=1;k--) {z=q[k]+d[k]; q[k-1]=q[...

Go to advanced search