各位大大我的程式又出了問題!內容如下:
#include<stdio.h>
int number;
int main(void)
{
menu();
if (number=1)
system("cls");
calculator();
return 0;
}
int menu(void)
{
printf("歡迎使用此系統 \n");
printf("請選擇有要用的功能代號 \n");
printf("1.計算機 \n");
printf("請選擇所要使用的功能代號:");
scanf("%d",&number);
}
int calculator(void)
{
int a,b,math;
char c;
scanf("%d %c %d",&a,&c,&b);
if (c="+")
math=a+b;
else if(c="-")
math=a-b;
else if (c="*")
math=a*b;
else (c="/");
math=a/b;
printf("%d \n",math);
}
為什麼不管我怎麼打!結果都"1"!為什麼會這樣??請各位大大指導!!
Thank you~~