Cod sursa(job #1179775)
Utilizator | Data | 29 aprilie 2014 11:53:05 | |
---|---|---|---|
Problema | Numarare triunghiuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
using namespace std;
ifstream f("mat.in");
ofstream g("mat.out");
int s,n,i,j,a[100],k;
int main()
{
f>>n;
for(i=1;i<=n;i++) f>>a[i];
for(i=1;i<=n;i++)
for(j=i;j<=n;j++)
for(k=j;k<=n;k++)
{
if(k>j+i) {s++; break;}
}
g<<s;
return 0;
}