Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
435 B
0
Indexable
Never
#include <iostream>
#include <cmath>
using namespace std;
int main() {
	int n, c;
	cin >> n;
	float b;
	b = 0.0;
	c = 0;
	float a[100];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < n; i++) {
		if (a[i] - int(a[i]) != 0) b += a[i];
		else c += a[i];
	}
	cout << "Summa int - " << c << endl << "Summa float - " << b << endl << "Raznitca - ";
	if (c >= b) cout << c - b;
	else cout << b - c;
}