Skip to main content
deleted 57 characters in body
Source Link
Andbdrew
  • 221
  • 1
  • 5

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 'They are the same!' else: print 'Integer A is greater than B.' if (abs(a-b)==a-b) else 'Integer B is greater than A.'

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 'They are the same!'
 else:
  return 'Integer A is greater than B.' if (abs(a-b)==a-b) else 'Integer B is greater than A.'

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 'They are the same!' else: print 'Integer A is greater than B.' if (abs(a-b)==a-b) else 'Integer B is greater than A.'

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 'They are the same!'
 else:
  return 'Integer A is greater than B.' if (abs(a-b)==a-b) else 'Integer B is greater than A.'

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b

Python

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 'They are the same!' else: print 'Integer A is greater than B.' if (abs(a-b)==a-b) else 'Integer B is greater than A.'

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 'They are the same!'
 else:
  return 'Integer A is greater than B.' if (abs(a-b)==a-b) else 'Integer B is greater than A.'

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b
added 2 characters in body
Source Link
Andbdrew
  • 221
  • 1
  • 5

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 0'They are the same!' else: print a'Integer A is greater than B.' if (abs(a-b)==a-b) else b

prints 0 is they are the same, otherwise it prints the larger of the two.

'Integer B is greater than A.'

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 0'They are the same!'
 else:
  return a'Integer A is greater than B.' if (abs(a-b)==a-b) else b'Integer B is greater than A.'

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 0 else: print a if (abs(a-b)==a-b) else b

prints 0 is they are the same, otherwise it prints the larger of the two.

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 0
 else:
  return a if (abs(a-b)==a-b) else b

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 'They are the same!' else: print 'Integer A is greater than B.' if (abs(a-b)==a-b) else 'Integer B is greater than A.'

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 'They are the same!'
 else:
  return 'Integer A is greater than B.' if (abs(a-b)==a-b) else 'Integer B is greater than A.'

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b
edited body
Source Link
Andbdrew
  • 221
  • 1
  • 5

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 0 else: print a if (abs(a-b)==a-b) else b

prints 0 is they are the same, otherwise it prints the larger of the two.

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 0
 else:
  return a if (abs(a-b)==a-b) else b

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 0 else: print a if (abs(a-b)==a-b) else b

prints 0 is they are the same, otherwise it prints the larger of the two.

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 0
 else:
  return a if (abs(a-b)==a-b) else b

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 0 else: print a if (abs(a-b)==a-b) else b

prints 0 is they are the same, otherwise it prints the larger of the two.

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b

Python - 63 58 110 characters

from sys import argv as s a,b=int(s[1]), int(s[2]) if a==b: print 0 else: print a if (abs(a-b)==a-b) else b

prints 0 is they are the same, otherwise it prints the larger of the two.

Python - 73 characters

if inputs as arguments is acceptable as 'input', it is only 73 characters:

def c(a,b):
 if a==b:
  return 0
 else:
  return a if (abs(a-b)==a-b) else b

if the weak inequality is all we care about, and we don't have to take input, it's shorter (33 characters):

print a if (abs(a-b)==a-b) else b
added 49 characters in body
Source Link
Andbdrew
  • 221
  • 1
  • 5
Loading
added 36 characters in body
Source Link
Andbdrew
  • 221
  • 1
  • 5
Loading
added 186 characters in body
Source Link
Andbdrew
  • 221
  • 1
  • 5
Loading
added 146 characters in body
Source Link
Andbdrew
  • 221
  • 1
  • 5
Loading
added 11 characters in body
Source Link
Andbdrew
  • 221
  • 1
  • 5
Loading
added 11 characters in body
Source Link
Andbdrew
  • 221
  • 1
  • 5
Loading
Source Link
Andbdrew
  • 221
  • 1
  • 5
Loading