2017蓝桥杯第一题

代码:

#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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值