Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
3-D array sum and search
//gcc 5.4.0 #include <stdio.h> int main(void) { int A[3][3][3]={{{1,2,3},{4,5,6},{7,8,9}},{{1,2,3},{4,5,6},{7,8,9}},{{1,2,3},{4,5,6},{7,8,9}}}; int n=3; int sum=0; int max=A[0][0][0]; for(int x=0;x<n;x++) for(int y=0;y<n;y++) for(int z=0;z<n;z++) if(A[x][y][z]>max){ max=A[x][y][z]; sum=sum+A[x][y][z]; printf("%d\n",A[x][y][z]); } else { sum=sum+A[x][y][z]; printf("%d\n",A[x][y][z]); } printf("max=%d\nsum=%d",max,sum); }
run
|
edit
|
history
|
help
0
Lab 5 HW Spring 2017 v1
Is const really const? Yes
PRIMER PROGRAMA CON MALLOC()
dining phylosopher
Linked List demo in C
Incometax problem v1.1
THIS one uwu
SIGABRT error
MatrixMul_shortxshort
Practice Problem 7