[sourcecode language="c"]
#include <iostream>
#include <string>
#include <sstream>
#include <cstdio>
using namespace std;
int main()
{
int n;
cin>>n;
int day[n],kgCount,kg[n];
double cost, kgSum= 0,moneySum = 0;
string line,str;
for(int i = 0; i<n; i++)
{
kgCount = 0;
cin>>cost;
moneySum+=cost;
cin.ignore();
getline(cin,line);
stringstream ss(line);
while(ss>>str)
{
kgCount++;
kgSum++;
}
kg[i] = kgCount;
cout<<"day "<<i+1<<": "<<kgCount<<" kg"<<endl;
}
printf("%.2lf kg by day\n",kgSum/n);
printf("R$ %.2lf by day\n",moneySum/n);
}
[/sourcecode]
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন