Untitled
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int tab[3][4] = {{0,1,2}, {3,4,5}, {6,7,8}}; int s_p= 0; for(int i = 0;i < 3;i++){ for (int j = 0;j < 3;j++){ if(i > j){ s_p = s_p + tab[i][j]; } } } cout<<s_p<<endl; system("PAUSE"); return EXIT_SUCCESS; }
Leave a Comment