Feb 26, 2014 at 7:39am Feb 26, 2014 at 7:39am UTC
thank you very much but
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
// ConsoleApplication28.cpp :
//
#include <iostream>
using namespace std;
int main()
{
int number;
cin>>number;
int m;
int friends[number]={};
for (int i=0;i<number;i++)
{
friends[i]=i+1;
}
for (int i=1;i<=m+1;i++)
{
for (int p=0;p<=number;p++)
{
if ( friends[p]%i!=0)
{
friends[i]=0;
}
}
}
for (int i=0;i<number;i++)
{
if (friends[i]!=0)
{
cout<<friends[i]<<endl;
}
}
}
why cant i compile this?thank you
Last edited on Feb 26, 2014 at 7:39am Feb 26, 2014 at 7:39am UTC
Feb 26, 2014 at 7:54am Feb 26, 2014 at 7:54am UTC
When a compiler refuses to compile something, it usually does tell a reason. An error message. The best long term solution is to learn to interpret the error messages, but for now you should show us the error message.