String compression

#include
#include
#include.
using namespace std;
int main() {
char s[1000];
cin.getline(s,’ ');
//string s;
//cin>>s;
int n=strlen(s);
//int n=s.length();
//sort(s,s+n);
//cout<<s;
if((n>=1)&&(n<=1000))
{int j=0;
int i;
char ch=s[j];
int no=1;
for(i=1;i<n+1;i++)
{

		if(ch==s[i])
		no++;
		else
		{
		cout<<ch<<no;
		ch=s[i];
		no=1;	
		}

	}
}
return 0;

}

test 1 fails
why?

Pls send the correct code… It is not showing anything on the ide…