Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <math.h>
- using namespace std;
- int j=3;
- int k=3;
- int h=3;
- int array[3][3][3];
- int sottoprogramma() {
- int scalino1= array[0][0][0];
- int scalino2= array[1][1][1];
- int scalino3= array[2][2][2];
- int max;
- if (scalino1>scalino2) {
- if (scalino1>scalino3) {
- max=scalino1;
- }
- else
- max=scalino3;
- }
- else {
- if (scalino2>scalino3) {
- max= scalino2;
- }
- else
- max=scalino3;
- }
- return max;
- }
- int main () {
- cout << "Inserisci 27 numeri interi: ";
- for (int i=0; i<j; i++) {
- for (int l=0; l<k; l++) {
- for (int m=0; m<h; m++) {
- cin >> array[i][l][m];
- }
- }
- }
- cout<<sottoprogramma();
- system ("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement