Code problem and changes

#include
using namespace std;
int main() {
int a[1000000000000000000]={0};
cin>>a;
for(int i=0;i<sizeof(a);i++){

	if(a[i]>9-a[i]){
		a[i]=9-a[i];
	}
	else{
		a[i]=a[i];
	}
}
for(int i=0;i<sizeof(a);i++){
	cout<<a[i];
}
return 0;

}

@neelrai906
hello Neel,
a)u cannot not make array of that big size.

  • at max u need to store 18 digits and for that 19 size array is sufficient.
  • or use string in place of array

b) if msb is 9 then dont change it to 0 .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.