『C言語入門経典』Ivor Horton第10章練習問題2
// 10.2 , , :
//$3.50,$4.75,$9.95,$2.50
#include<stdio.h>
#define count 4
int main(void)
{
double amount[count];
double total;
printf("enter the four data
");
for(int i=0;i<count;i++)
{
scanf("%*[ $,]%lf",&amount[i]);
total+=amount[i];
}
printf("
the total is %lf",total);
return 0;
}