Cod:
int main() {
int numere ;
fin >> numere;
numere = numere * 2;
//ax^2 + bx + c = 0;
//x^2 - x - numere = 0;
int x1 = (1 + sqrt(1 + 4 *(double) numere)/2);
int myArray[225];
int ab = 0;
int bc = 0;
int ac = 0;
int z = 0;
fout << x1 << "\n";
for (int i = 1; i <=x1 ; i ++) {
fin >> myArray[i-1];
if (i == 1){
ab = myArray[i-1];
}else if (i == 2){
ac = myArray[i-1];;
}else if(i == x1){
bc = myArray[i-1];;
}
}
int a = (ab + ac - bc)/2;
fout << a << " ";
for (int y = 1 ; y < x1;y++) {
fout << myArray[y-1] - a << " ";;
}
return 0;
}
nu pot sa-mi dau seama ce este gresit .. scuze daca este prea evident si eu chiar nu vad o "banalitate"
