Блог пользователя rohansoni649

Автор rohansoni649, история, 3 года назад, По-английски

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; }

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    maybe format it correctly? or just read the editorial.

  • »
    »
    3 года назад, # ^ |
    Rev. 3   Проголосовать: нравится +8 Проголосовать: не нравится
    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

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    You need to use Markdown bro.

    How to put code in a blog