adauga ce o fi asta in plm l-am facut aseara dar am uitat sa dau commit lol

This commit is contained in:
fzorb 2025-05-11 10:14:40 +03:00
parent cf40dce705
commit f5e92827e7

27
3033/solutie.cpp Normal file
View file

@ -0,0 +1,27 @@
#include <iostream>
#include <math.h>
using namespace std;
int main() {
int n, a=0, cp = 0, s = 0, b=0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> b;
cp = b;
a = 0;
while (cp != 0) {
a++;
cp = cp / 10;
}
cp = b;
if (a % 2 == 1) {
for (int j = 0; j < (a-1)/2; j++) {
cp = cp / 10;
}
s = s + (cp%10);
}
}
cout << s;
return 0;
}