BUPT-homework/semester1/pset2/2-num.c

19 lines
407 B
C
Raw Normal View History

2021-09-28 22:44:09 +08:00
#include <stdio.h>
int main(void) {
// initialize variables
int a, b;
scanf("%d %d", &a, &b);
// print answer (I don't want to assign vars lol)
if (a == b) {
printf("The two numbers are equal.");
} else if (a > b) {
printf("The larger number is %i, the smaller number is %i.", a, b);
} else {
printf("The larger number is %i, the smaller number is %i.", b, a);
}
return 0;
}