calc
calc_type = input('Would operation would you like to do (+, -, *, /)?: ')
print('\n')
num1 = int(float('Enter first number: '))
num2 = int(float('Enter second number: '))
if calc_type == '+':
answer_a = num1 + num2
print('\n:', num1, '+', num2, '=', answer_a)
elif calc_type == '-':
answer_s = num1 - num2
print('\n:', num1, '-', num2, '=', answer_s)
elif calc_type == '*':
answer_m = num1 * num2
print('\n:', num1, '+', num2, '=', answer_m)
elif calc_type == '/':
answer_d = num1 / num2
print('\n:', num1, '/', num2, '=', answer_d)
else:
print('\nInvalid Input!')
#include <iostream>
#define LOG(x) std::cout << x << std::endl
struct BadGamer{
void BAD(){
LOG("Uses Calculator and is Bad at games");
}
};
struct GoodGamer{
void GOOD(){
LOG("Doesn't use Calculator and is Good at games");
}
};
int main(){
int rep;
LOG("Do you Use calculator");
std::cin >> rep >> std::endl;
if(rep == 1){
BadGamer.BAD();
}
if(rep == 0){
GoodGamer.GOOD();
}else{
std::cout << "BRUUH" std::endl;
}
}