Cod sursa(job #583178)
Utilizator | Data | 18 aprilie 2011 16:45:05 | |
---|---|---|---|
Problema | Dreptunghiuri | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.26 kb |
#include<fstream>
using namespace std;
ifstream f("dreptunghiuri.in");
ofstream g("dreptunghiuri.out");
int main()
{int n,m,i,j,nr=0,q;
long long s=0;
f>>n>>m;
for(i=1;i<=n-1;i++)
{for(j=1;j<=m-1;j++)
nr++;}
for(q=1;q<=nr;q++)
s+=q;
g<<s;
}