标签:计算 span bsp warning color logs turn 第一个 include
1 # define _CRT_SECURE_NO_WARNINGS 2 #include <stdio.h> 3 int main() 4 { 5 6 7 while (true) 8 { 9 10 double a, b; 11 12 char or; 13 printf("请输入第一个数字:"); 14 scanf("%lf", &a); 15 printf("请输入运算符:"); 16 scanf("%s", &or); 17 printf("请输入第二个数字:"); 18 scanf("%lf", &b); 19 20 if (or == ‘+‘) 21 { 22 printf("运算结果是:%lf\n\n", a + b); 23 } 24 else if (or == ‘-‘) 25 { 26 printf("运算结果是:%lf\n\n", a - b); 27 } 28 else if(or == ‘/‘) 29 { 30 printf("运算结果是:%lf\n\n", a / b); 31 } 32 else if(or == ‘*‘) 33 { 34 printf("运算结果是:%lf\n\n", a * b); 35 } 36 else 37 { 38 printf("请输入正确的运算符!>> 请输入+ - * / "); 39 } 40 41 } 42 43 return 0; 44 }
标签:计算 span bsp warning color logs turn 第一个 include
原文地址:http://www.cnblogs.com/xuby/p/6511404.html