我的switch 语句错在哪?
程序代码:
#include <stdio.h> #include <math.h> #define S sum=sum double change(char c[10]) {int t; double q,sum=0; for(t=0;t<10;t++) {q=pow(16,9-t); switch(c[t]) case 'a':S+10*q;break; case 'b':S+11*q;break; case 'c':S+12*q;break; case 'd':S+13*q;break; case 'e':S+14*q;break; case 'f':S+15*q;break; default:S+(c[t]-48)*q;}//What's wrong with my switch? return sum;}