Cod sursa(job #638117)
Utilizator | Data | 20 noiembrie 2011 18:59:12 | |
---|---|---|---|
Problema | Ferma2 | Scor | 0 |
Compilator | cpp | Status | done |
Runda | .com 2011 | Marime | 0.28 kb |
#include<fstream>
using namespace std;
ifstream in("ferma2.in");
ofstream out("ferma2.out");
const int MAX=700;
int main()
{int n,k,i,j,a[MAX][MAX],suma=0;
in>>n>>k;
for(i=1;i<=n;i++)
for(j=1;j<=i;j++)
{
in>>a[i][j];
suma+=a[i][j];}
out<<suma;
}