12.11.2012, 18:58. Просмотров 323. Ответов 6
я понимаю что написал код не правильно исправьте пожалуйста
#include <conio.h>
#include <math.h>
#include <iostream>
using namespace std;
int main()
{int n,m,S,d,i,x, maxd=0,c=0;
cout<<"vvedite n and m";
cin>>n>>m;
for(i=n; i<=m;i++)
{S=0;
maxd=0;
for(x=n; x<=m;x++)
{for(d=1; d<=x;d++)
{ if(d<x+1)
while(x/d==0);
{ S=S+1;
}
}
}
if(maxd<S)
c=x;
maxd=S;
}
cout <<"maxd, c"<<maxd<<c;
getch();
return 0;
}