1 solutions
-
0
C++ :
#include <iostream> using namespace std; int main() { bool flag=true; for(int i=11;i<=99;++i) { int a=i/10,b=i%10; if(a*b+a+b==a*10+b) { if(flag==true) { cout << a*10+b; flag=false; } else cout << "," << a*10+b; } } return 0; }Pascal :
var f,i,a,s:integer; begin for i:=10 to 99 do begin a:=i div 10; s:=i mod 10; if a*s+a+s=i then if f=0 then begin write(i);f:=1;end else write(',',i); end; end.
- 1
Information
- ID
- 17445
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By