代码:
#include<cstring>
#include<cmath>
#include<cstdio>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
double ar[500+5];
int main()
{
string ss;
cin>>ss;
int b,c;
double a,s,s1=0;
while(scanf("%lf %d",&a,&b)&&b)
{
s=a*b/100;
cout<<s<<endl;;
s1+=s;
cin>>ss;
}
cout<<s1<<endl;
return 0;
}
文件预处理:
**** 180.90 88
**** 10.25 65
**** 56.14 90
**** 104.65 90
**** 100.30 88
**** 297.15 50
**** 26.75 65
**** 130.62 50
**** 240.28 58
**** 270.62 80
**** 115.87 88
**** 247.34 95
**** 73.21 90
**** 101.00 50
**** 79.54 50
**** 278.44 70
**** 199.26 50
**** 12.97 90
**** 166.30 78
**** 125.50 58
**** 84.98 90
**** 113.35 68
**** 166.57 50
**** 42.56 90
**** 81.90 95
**** 131.78 80
**** 255.89 78
**** 109.17 90
**** 146.69 68
**** 139.33 65
**** 141.16 78
**** 154.74 80
**** 59.42 80
**** 85.44 68
**** 293.70 88
**** 261.79 65
**** 11.30 88
**** 268.27 58
**** 128.29 88
**** 251.03 80
**** 208.39 75
**** 128.88 75
**** 62.06 90
**** 225.87 75
**** 12.89 75
**** 34.28 75
**** 62.16 58
**** 129.12 50
**** 218.37 50
**** 289.69 80