📄 emp1_08.cpp
字号:
// {emp1_08}
#include"tools.h"
long int LI;
void InputLongIntInWnd(int x1,int y1,int x2,string s0,long int& LI )
{ char *endptr;
gwindow gwnd;
Gwindow_init(gwnd,x1,y1,x2,y1);
Gwindow_newwindow(gwnd);
unsigned char sss[70]="";
strcpy(sss,s0);
int n=gwnd.x2-gwnd.x1-strlen(s0);
do
{
unsigned char s1[70]="";
Gwindow_showstring(gwnd,1,1,sss);
Gwindow_inputstring(gwnd,1+strlen(sss),1,s1);
unsigned char s2[70]="";
Rtrim(s1,s2);
unsigned char s3[70]="";
Ltrim(s2,s3);
LI=strtol(s3,&endptr,10);
if(*endptr!='\0')
{Error("format of data error,input again!");
Gwindow_clear_line(gwnd,1);
}
}
while( !(*endptr=='\0') );
Gwindow_done(gwnd);
}
main()
{
Into_graph();
InputLongIntInWnd(10,10,40,"输入长整型数据:",LI);
cout<<LI<<endl;
getch();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -