eolymp
Задачі

Сума кількох дійсних

опубліковано 03.05.21, 21:15:34

include <iostream>

include <string>

include <iomanip>

include <cmath>

using namespace std;

int main () {

string a,b,c,d;

cin >> a >> b >> c>>d;

cout << fixed << setprecision (4) << stof(a) +stof(b) <<endl<< stof(a) +stof(b)+stof(c) <<endl<< stof(a) +stof(b)+stof(c)+stof(d);

}

опубліковано 15.04.22, 19:04:40

include <iostream>

include <cmath>

using namespace std;

int main () {

double a,b,c,d;

cin >> a >> b >> c>>d;

cout.precision(4); cout<<fixed<<a+b<<endl; cout<<fixed<<a+b+c<<endl; cout<<fixed<<a+b+c+d; return 0; }

опубліковано 27.07.22, 23:43:34

include<bits/stdc++.h>

using namespace std; int main(){ long double x,y,z,p; cin>>x>>y>>z>>p; cout<<setprecision(4)<<fixed<<x+y<<" "<<x+z+y<<" "<<z+y+x+p; }

опубліковано 30.10.22, 19:16:04

vaqif cix cole

опубліковано 28.07.23, 21:37:27

include <iostream>

using namespace std; int main(){ double a,b,c,d; cin>>a>>b>>c>>d; cout.precision(4); cout<<fixed<<a+b<<endl; cout<<fixed<<a+b+c<<endl; cout<<fixed<<a+b+c+d<<endl; }