Răspuns:
1.
#include <iostream>
#include <fstream>
using namespace std;
ofstream fout("iesire.out");
int n;
int main()
{
cin>>n;
while(n!=0)
{
fout<<n<<" ";
cin>>n;
}
return 0;
}
2.
include <iostream>
#include <fstream>
using namespace std;
ofstream fout("date.out");
int n;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
for(int k=1;k<=i;k++)
{
for(int l=1;l<=i;l++)
cout<<i<<" ";
cout<<endl;
}
}
return 0;
}
3.
include <iostream>
using namespace std;
int p,i;
int main()
{
cin>>p;
for(i=1;i+i<p;i++)
cout<<i<<" "<<i<<" "<<p-i-i<<endl;
return 0;
}
4.
include <iostream>
#include <fstream>
using namespace std;
ofstream fout("pare.out");
int n,i;
int main()
{
cin>>n;
for(i=2;s<n;i+=2)
{
if(s+i<=n)
{
s+=i;
cout<<i<<" ";
}
else break;
}
return 0;
}