fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x,a,b,c,d,arj;
  6. cin>>x;
  7. a=x/1000;
  8. b=(x-1000*a)/100;
  9. c=(x-1000*a-100*b)/10;
  10. d=x-1000*a-100*b-10*c;
  11. arj=x/(a+d);
  12. if(x<5000)
  13. {
  14. cout<<arj;
  15. }
  16. else
  17. {
  18. cout<<x;
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 4344KB
stdin
4567
stdout
415