Pagini recente » Cod sursa (job #3249568) | Cod sursa (job #1962949) | Cod sursa (job #328047) | Cod sursa (job #668214) | Cod sursa (job #721674)
Cod sursa(job #721674)
// puteri.cpp : Defines the entry point for the console application.
//
//#include "stdafx.h"
#include "fstream"
using namespace std;
int main()
{
ifstream f("puteri.in");
ofstream g("puteri.out");
int a[80000][3],n;
int i;
f>>n;
for(i=0;i<n;i++)
f>>a[i][0]>>a[i][1]>>a[i][2];
int j;
int sol=0;
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
{
int tmp1,tmp2,tmp3;
tmp1=0;
tmp2=0;
tmp3=0;
tmp1=a[i][0]+a[j][0];
tmp2=a[i][1]+a[j][1];
tmp3=a[i][2]+a[j][2];
int l;
for(l=2;l<=tmp1;l++)
if((tmp1%l==0)&&(tmp2%l==0)&&(tmp3%l==0))
{
sol++;
break;
}
}
g<<sol;
return 0;
}