16 si 19 cu Structura repetitivă while. C++ .Multumesc!

Răspunsuri la întrebare
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int r, x, y;
cin >> r;
float z;
cout << "("<<0<<","<<r<<") ";
cout << "("<<0<<","<<-r<<") ";
cout << "("<<-r<<","<<0<<") ";
cout << "("<<r<<","<<0<<") ";
x=1;
while (x<r)
{
z=sqrt(r*r-x*x);
if (z==(int)z)
{
y=z;
cout << "("<<x<<","<<y<<") ";
cout << "("<<x<<","<<-y<<") ";
cout << "("<<-x<<","<<y<<") ";
cout << "("<<-x<<","<<-y<<") ";
}
++x;
}
return 0;
}
----------------------------------------problema 19
#include <iostream>
using namespace std;
int main()
{
int a=1, b, c, p;
cout << "p="; cin >> p;
cout << "triplete - triunghiuri:\n";
while (a<p)
{
b=a;
while (b<p)
{
c=p-a-b;
if (a+b>c && a+c>b && b+c>a)
cout << "("<<a<<","<<b<<","<<c<<") ";
++b;
}
++a;
}
return 0;
}