Răspunsuri

2014-06-09T17:56:56+03:00
#include<iostream>
using namespace std;
int main()
{int i,a,b,c,P,s;
cin>>P;
while(s<=P)
{a=1;
b=2;
c=3;
s=a+b+c;
if(s==P && a+b<=c)
cout<<a<<b<<c;
else
{a++,b++,c++;}
}
}
mersi da cautam backtracking,vina mea,trebuia sa mentionez