Answer the question
In order to leave comments, you need to log in
How can you get other font-weight fonts from one regular?
Are there any services or programs that can be used to get several fonts from one file with the '.ttf' font, but not formats like '.eot' , 'woff' but the font weight, that is,
(font weight) & (font-weight) . If there is, please send the link ... I searched the internet, but I did not find anything useful besides font format converters.
Answer the question
In order to leave comments, you need to log in
If I understood correctly, it is necessary to calculate how many elements fell into the groups in total.
int main(int argc, char* argv[])
{
long a[] = { 1, 2, 3, 2, 1, 4, 3, 3};
std::cout << "Initial array: " << std::endl;
for (const auto& it : a)
std::cout << it << ' ';
std::cout << std::endl;
int groupCount = 0;
int totalItemsInGroups = 0;
int n = sizeof(a) / sizeof(a[0]);
for (int i = 0; i < n && a[i] != 0; i++) {
long itemsInGroup = a[i];
int count = 0;
for (int j = i; j < n; j++) {
if (a[j] == itemsInGroup) {
a[j] = 0;
count++;
if (count == itemsInGroup) {
groupCount++;
totalItemsInGroups += itemsInGroup;
count = 0;
}
}
}
}
std::cout << "Group count: " << groupCount << std::endl
<< "Total count of grouped items: " << totalItemsInGroups;
return 0;
}
Initial array:
1 2 3 2 1 4 3 3
Group count: 4
Total count of grouped items: 7
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question