请大家帮 看看 谢谢
c代码
-----------
#include <stdio.h>
  #include <string.h>
  
  int main()
  {
   char* PI = "31415926535897932384";//20位
   char szUserName[80];
   int nLen;
   int i;
   char c;
  
   do 
   {
   printf("请输入用户名:");
   scanf("%s", szUserName);//赋值到SZUSERNAME数组
   nLen = strlen(szUserName);//得到NAME的输入长度
   if (nLen >= 5 && nLen <= 0x14) break;//如果长度大于等于5和小于等于16调处循环
   } while(true);
  
   printf("注册码:");//输出注册码
   for (i = 0; i < nLen; i++)//注册码 运算//I=0,I《注册名的长度就继续
   {
   c = szUserName[i] % PI[i];//数组的第一位跟PI的第一位求余放到c中
   c <<= 1;//c左移1位
   if (c > 'z') c = 0x1a;//判断如果c大于"z"则c=0xa
   if (c < 'A') c = 0x82 - c;//判断如果c小于"A"则c=0x82-c
   if (c > 'A' && c < 'a') c = c % 0xA + 0x30;//判断如果c同时大于"A"小于"a"则c=c跟0xA求余加上0x30
   printf("%c", c);//输出c
   }
   printf("\n");
  }
---------------------
下面是我的delphi代码
--------------
procedure TForm1.Button1Click(Sender: TObject);
var
//const pi=31415926535897932384;
pi:ansistring;szname:ansistring;
i:integer;
c,cd,nlen:variant;begin
{usp:='1234567890';
asp:=copy(usp,1,1);
Edit1.Text:=asp;
end;}
pi:='31415926535897932384';
szname:=Edit1.text;
nlen:=length(szname);
  showmessage(nlen);
if nlen >= 5 and nlen <= 14 then
showmessage("长度大于等于5和小于等于16了!");
else
   for i:=0 to i < nlen do
   begin
   c:=copy(szname,i,1) mod copy(pi,i,1);
   c:=c shl 1;
   if c> 'z' then c:=$1a;
   if c< 'A' then c:=$82-c;
   if c> 'A' and c< 'a' then c:= c mod $A + $30;
   cd:=cd+c;
   end;end.
----
我在按F9的时候delphi提示这个错误
[错误] Unit1.pas(46): Incompatible types//也就是
(if nlen >= 5 and nlen <= 14 then)这行我不知道怎么搞 汗啊``小弟刚入门请求大哥们帮忙
再次谢谢