Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream cin("numere14.in");
- ofstream cout("numere14.out");
- int main()
- {
- int n, s = 0;
- cin >> n;
- for(int i = 1; i <= n; ++i)
- {
- int x, X, cifre = 1, c;
- cin >> x;
- X = x;
- while(x > 9)
- {
- ++cifre;
- x /= 10;
- }
- cifre /= 2;
- for(int i = 1; i <= cifre; ++i)
- {
- X /= 10;
- }
- c = X % 10;
- if(c % 2 != 0) s += c;
- }
- cout << s;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement