#include
using namespace std;
int main()
{
int x, y, mat[4][4], soma=0;
for(x=0;x<4 font="" x="">4>
{
for(y=0;y<4 font="" y="">4>
{
cout<<"\nlinha"<
cin>>mat[x][y];
}
}
//soma todos os numeros acima da DP
for(x=0;x<4 font="" x="">4>
for(y=0;y<4 font="" y="">4>
if(x
soma+=mat[x][y];
//saida
system("cls");
{
for(x=0;x<4 font="" x="">4>
if(x
cout<
else
cout<<"\t";
cout<<"\n";
}
cout<<"\n\nSoma: "<
cout<<"\n\n";
system("pause");
}
using namespace std;
int main()
{
int x, y, mat[4][4], soma=0;
for(x=0;x<4 font="" x="">4>
{
for(y=0;y<4 font="" y="">4>
{
cout<<"\nlinha"<
cin>>mat[x][y];
}
}
//soma todos os numeros acima da DP
for(x=0;x<4 font="" x="">4>
for(y=0;y<4 font="" y="">4>
if(x
soma+=mat[x][y];
//saida
system("cls");
{
for(x=0;x<4 font="" x="">4>
if(x
cout<
else
cout<<"\t";
cout<<"\n";
}
cout<<"\n\nSoma: "<
cout<<"\n\n";
system("pause");
}
Comentários
Postar um comentário