1) #include <iostream>
using namespace std;
int main(){
int n, a, b;
cin >> n >> a;
for(int i = 1; i < n; i++) {
cin >> b;
if(a % 10 == b % 10)
cout << a <<" " << b << endl;
a = b;
}
}
2) progresia aritmetica
#include <iostream>
using namespace std;
int main(){
int n, a, r;
cin >> a >> r >> n;
for(int i = 1; i <= n; i++) {
cout << a << " ";
a = a + r;
}
}
progresie geometrica
#include <iostream>
using namespace std;
int main(){
int n, a, r;
cin >> a >> r >> n;
for(int i = 1; i <= n; i++) {
cout << a << " ";
a = a * r;
}
}