Compile Error
/in/foo.c:1:19: fatal error: iostream: No such file or directory #include<iostream> ^ compilation terminated.
代码
#include<iostream>
using namespace std;
int f[105][105],n,m;
void floyed()
{
int i,j,k;
for(k=1;k<=n;k++)
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
if(f[i][k]&&f[k][j])f[i][j]=1;
}
int main()
{
int i,j,k,x,y;
cin>>n>>m;
for(i=1;i<=m;i++)
{
cin>>x>>y;
f[x][y]=1;
}
floyed();
int ans=0,num=0;
for(i=1;i<=n;i++)
{
num=0;
for(j=1;j<=n;j++)
{
if(f[i][j])num++;
}
if(num>=(n+1)/2)ans++;
num=0;
for(j=1;j<=n;j++)
{
if(f[j][i])num++;
}
if(num>=(n+1)/2)ans++;
}
cout<<ans;
}