Pascal: var n,b:longint; begin write('N = '); readln (n); b:=n mod 10; while (n div 10 <> 0) do n:=n div 10; if n>b then writeln ('First!') else if b>n then writeln ('Second!') else writeln ('First and Second equal!'); end.
C++: #include <iostream> using namespace std;
int main() { int n,a; cout <<"N = "; cin >>n; a = n%10; while (n/10!=0) n/=10; if (n>a) cout <<"First!" <<endl; else if (a>n) cout <<"Second!" <<endl; else cout <<"First and Second equal" <<endl; return 0; }
var n,b:longint;
begin
write('N = ');
readln (n);
b:=n mod 10;
while (n div 10 <> 0) do n:=n div 10;
if n>b then writeln ('First!') else
if b>n then writeln ('Second!') else writeln ('First and Second equal!');
end.
C++:
#include <iostream>
using namespace std;
int main()
{
int n,a;
cout <<"N = ";
cin >>n;
a = n%10;
while (n/10!=0)
n/=10;
if (n>a)
cout <<"First!" <<endl;
else if (a>n) cout <<"Second!" <<endl;
else cout <<"First and Second equal" <<endl;
return 0;
}