|
|
back to boardWrong test #6 help me friends please !!! this is my solution #include <iostream> #include <cmath> using namespace std; int main() { long long a,b,s=0,d=0,k=0,jama,kk=0,ss=0,dd=0; cin>>b; a=b; b=b-1; while(b-1>0) { jama=b%10; k++; if(k<=3) { s+=jama; } else{ d+=jama; } b/=10; } int i=0; if(s-d==0 ) { i++; } a=a+1; int joma; while(a>0) { joma=a%10; kk++; if(kk<=3) { ss+=joma; } else{ dd+=joma; } a/=10; } if(ss-dd==0 ) { i++; } if(i>0) { cout<< "Yes"; } else cout<< "No"; return 0; } Re: Wrong test #6 help me friends please !!! Posted by ELDVN 2 Nov 2015 00:37 [delete] Edited by author 02.11.2015 00:38 Edited by author 02.11.2015 00:38 |
|
|