Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {
- "collapsed": false
- },
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "210\n",
- "711\n",
- "313\n",
- "37\n",
- "113\n",
- "117\n",
- "416\n",
- "1218\n"
- ]
- }
- ],
- "source": [
- "from math import *\n",
- "\n",
- "def f(x,y):\n",
- " result = (x+y) + (pow(10, 1 + int(log10(x+y))) * (x-y))\n",
- " print(int(result))\n",
- "\n",
- " \n",
- "f(6,4)\n",
- "f(9,2)\n",
- "f(8,5)\n",
- "f(5,2)\n",
- "f(7,6)\n",
- "f(9,8)\n",
- "f(10,6)\n",
- "f(15,3)\n"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.4.3"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement