Răspuns:
Pb 1.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a+abs(a-b);
return 0;
}
Pb 2
#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
if(n%i==0)
cout<<i<<" ";
return 0;
}
Daca nu intelegi ceva intreaba-ma
Explicație: