There are two arrays - the first is the representation of the date of birth (DD.MM.YYYY) as a set of numbers, the elements of the second array are obtained by some transformations over the date of birth (such as adding the digits of the day and month, then the year, etc.).
Example of the first array: {2,2,0,1,1,9,9,3}
Example of the second array: {3,7,6,7,5}
It is necessary to register in the matrix of the form: exactly as many digits i are recorded in the element i as many as they occur in the above arrays.
1 4 7 2 5 8 3 6 9 (the account goes vertically) and in the final work
11 - 77 22 5 - 33 6 99 type insert numbers into the matrix (don’t know how to insert) if someone doesn’t understand the task, google the Pythagorean square
this is what is available at the moment:
#include <iostream> using namespace std; int main() { const int indate = 8, dvozn=1; int date[indate], numb[dvozn], sum = 0, sum2 = 0, sum3 = 0; cout << "Vvedit' datu narodzhenia v cyfrah(1 9 9 0 1 1 2 9" << endl; for (int i = 0; i < indate; i++) { cin >> date[i]; //1 number sum += date[i]; } numb[0] = sum; //2 number while (sum > 9) { sum = ((sum / 10) + (sum % 10)); } //3 number int tmp = 0; cout << date[0] << " " << date[1] << " " << ((date[0] * 10) + (date[1])) * 2 << endl; tmp += ((date[0] * 10) + (date[1]))*2; sum2 = numb[0] - tmp; if (sum2 < 0) sum2 *= -1; sum3 = sum2; while (sum3 > 9) { sum3 = ((sum3 / 10) + (sum3 % 10)); } cout << endl << sum << " " << sum2 << " " << sum3 << endl; //zapovnennia tablyci for (int i = 0; i < indate; i++) { cout << date[i]; } cout << endl; const int size5 = 5; int dat[size5]; dat[0] = numb[0]/10; dat[1] = numb[0]%10; dat[2] = sum; dat[3] = sum2; dat[4] = sum3; for (int i = 0; i < size5; i++) { cout << dat[i] << "-"; } cout << endl; const int size = 3; int arr[size][size]; for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { } } } help please, well don `t know how to fill it and that's it. I'm already thinking about the day
11is an array of two units or the number 11? - yrHeTaTeJlb1111isint i = 1111;orstd::vector<int> v = {1, 1, 1, 1};? - yrHeTaTeJlb