Here is the code for the extended Euclidean algorithm in C++:

```
#include<bits/stdc++.h>
using namespace std;

int gcdExtended(int a, int b, int *x, int *y)  
{  
    if (b == 0)  
    {  
        *x = 1;  
        *y = 0;  
        return a;  
    }  
    
    int x1, y1; 
    int gcd = gcdExtended(b, a % b, &x1, &y1);  
    
    *x = y1;  
    *y = x1 - (a / b) * y1;  
    
    return gcd;  
}  

int main()  
{  
    int x, y;  
    int a = 35, b = 15;  
    int gcd = gcdExtended(a, b, &x, &y);  
    cout << "gcd(" << a << ", " << b << ") = " << gcd << endl;  
    cout << "The values of x and y are x = " << x << ", y = " << y << endl;  
    return 0;  
}  
```

This code defines a function `gcdExtended` that takes two integers `a` and `b` as input, and computes their greatest common divisor (`gcd`), as well as the values of `x` and `y` that satisfy the equation `ax + by = gcd(a,b)`. The function returns `gcd`.

In the `main()` function, we call `gcdExtended` with input values `a=35` and `b=15`, and print the results. The values of `x` and `y` are printed separately.
Scrivi l'algoritmo GCD esteso in C++.