rohansoni649's blog

By rohansoni649, history, 2 months ago, In English

include <bits/stdc++.h>

using namespace std;

int beautiful_year(int y) { int flag=0,i=0,digit[10],j=0; while(y) { digit[i++]=y%10; y=y/10; } int size=sizeof(digit)/sizeof(digit[0]); for(i=0;i<size;i++) { for(j=i;j<size;j++) { if(digit[i]==digit[j]) return 0; else flag=1;
} } if(flag==1) return 1; else return 0; } int main() { int year; cin>>year; year++; while(year) { if(beautiful_year(year)) { cout<<year; break; } year++; } return 0; }

 
 
 
 
  • Vote: I like it
  • -9
  • Vote: I do not like it

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

The code has been down voted. can you please tell me as I a beginner on this platform

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Your blog getting downvotes because it is not formatted. Try to provide question link , tell your approach and your code in spoiler form or your submission link will work. Thanks

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    maybe format it correctly? or just read the editorial.

  • »
    »
    2 months ago, # ^ |
    Rev. 3   Vote: I like it +8 Vote: I do not like it
    Because it was badly formated

    Any how, here is what you should do when writting an asking blog

    • You should describe main things in your problem: The statement, constraint, give some examples....

    • Then describe your approach, your problem, paste your code...

    • Finally ask for a solution, better way

    By the way, dont be pressure when you lost your contribution (but you should notice to improve your comment, blogs, ...). Since it use weird calculating system. Once I got over $$$500$$$ downvotes with $$$-55$$$ contributions but that doesnt matter on my rate

  • »
    »
    2 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You need to use Markdown bro.

    How to put code in a blog