We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
#include <stdio.h> #include <stdlib.h>
int main() { double num1, num2; char op;
printf("输入第一个数字:"); scanf("%lf", &num1); printf("输入运算符 (+、-、*、/): "); scanf(" %c", &op); printf("输入第二个数字:"); scanf("%lf", &num2); switch (op) { case '+': printf("%.2lf + %.2lf = %.2lf\n", num1, num2, num1 + num2); break; case '-': printf("%.2lf - %.2lf = %.2lf\n", num1, num2, num1 - num2); break; case '*': printf("%.2lf * %.2lf = %.2lf\n", num1, num2, num1 * num2); break; case '/': if (num2!= 0) { printf("%.2lf / %.2lf = %.2lf\n", num1, num2, num1 / num2); } else { printf("除数不能为零!\n"); } break; default: printf("无效的运算符!\n"); } return 0;
}
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: