fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int k(int x) {
  6. return x += (x % 10) / 5 * 10 - x % 10;
  7. }
  8.  
  9. int main() {
  10. cout << k(14) << endl;
  11. cout << k(15) << endl;
  12. cout << k(16) << endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
10
20
20