參考代碼:
#include?<stdlib.h>
int?main()
{
char?str1[20],?str2[20];
scanf("%s",?str1);
scanf("%s",?str2);
/*使用atof函數轉換*/
printf("%s?+?%s?=?%lf\n",?str1,?str2,?atof(str1)+atof(str2));
return?0;
}
運行效果: