這是我到目前爲止。它不會工作。我試圖寫它得到一個量的用戶輸入和他們住在縣和程序與稅收使用開關盒
#include<iostream>
using namespace std;
int main()
{
char amt = 0;
double county ;
char x = 0;
double total = 0;
total = amt + x;
x = county;
printf("\nplease enter amount\n");
scanf_s("%d",&amt);
printf("\nplease enter county\n");
scanf_s("%c",&x);
scanf_s("%c",&total);
printf("total:", amt * x);
switch(x)
{
case 'o':
printf("orange:",county = 0.06);
break;
case 'l':
printf("lake:",county = 0.07);
break;
case 's':
printf("seminole:",county = 0.08);
break;
}
system("pause");
}
什麼似乎是問題? – Argote 2011-03-14 20:47:39
你能否詳細說明「不行」? – 2011-03-14 20:47:51
可能重複的[你如何使用開關盒與數學](http://stackoverflow.com/questions/5294186/how-do-you-use-switch-case-with-math) – Jason 2011-03-14 20:52:45